一:启动网关服务(需要启动其它服务,如:AuthApplication 、UserApplication、BladeLogApplication,及自己添加的代码服务)
二:http://localhost:8080/blade-auth/oauth/token(注意端口号)
三:postURL:http://localhost:8080/blade-auth/oauth/token
请求头加Authorization 值:Basic c3dvcmQ6c3dvcmRfc2VjcmV0
参考代码 [{"key":"Authorization","value":"Basic c3dvcmQ6c3dvcmRfc2VjcmV0","description":"","type":"text","enabled":true}]
四:表单:
grant_type : password
scope : all
username : admin
password : admin
五:GET访问编写的API
http://localhost:8080/blade-demo/api/info?name=shao
六:请求头加Authorization 值:Basic c3dvcmQ6c3dvcmRfc2VjcmV0
七:请求头加blade-auth 值:http://localhost:8080/blade-auth/oauth/token返回的"token_type"值加空格再加access_token
八:成功调用
Hello, My Name Is: shao