我访问 http://localhost:8080/oauth/authorize?client_id=abc&response_type=code&redirect_uri=http://www.baidu.com,登录成功后,跳转到了http://www.baidu.com?code=1Sr24
这样的话,还需要客户端去写一个回调函数,来接收code并请求/oauth/token来获取access_token,请问spring-security-oauth2有没有提供现成的来处理授权码code?
我看客户端里配置了client-id和client-secret,好像没有地方可以自动用到?
auth-server: http://localhost:8080
security:
oauth2:
client:
client-id: abc
client-secret: 123456
access-token-uri: ${auth-server}/oauth/token
user-authorization-uri: ${auth-server}/oauth/authorize
resource:
user-info-uri: ${auth-server}/user
oauth2有4种授权模式,您可以根据情况进行选择。
http://www.ruanyifeng.com/blo...