隐式授权
访问
http://localhost:8080/oauth/authorizeclient_id=clientapp&redirect_uri=http://localhost:9001/callback&response_type=token&scope=admin&state=abc
如果没登录会跳转登录界面(登录账号密码使用的是spring security账号密码)
注意:隐式授权和授权码授权的区别,response_type在隐式授权里面使用的是token
跳转到redirect_uri之后,在网址后面会有access_token,使用access_token即可访问接口
(隐式授权不需要使用用户账号密码登录?)
密码登录
访问:http://localhost:8080/oauth/tokenpassword=123456&grant_type=password&username=lll&scope=admin
客户端凭证模式
访问:http://localhost:8080/oauth/token?grant_type=client_credentials&scope=admin
将grant_type修改为client_credentials