spring security oauth

一、 资源服务器设置验证token的地址
https://blog.csdn.net/qq_38157516/article/details/100665491

  1. RemoteTokenServices调用授权服务器的/oauth/check_token接口 校验token,获取用户信息并返回
final RemoteTokenServices tokenServices = new RemoteTokenServices();
//设置授权服务器check_token端点完整地址
tokenServices.setCheckTokenEndpointUrl("http://localhost:8080/oauth/check_token");
  1. 授权服务器/oauth/check_token 调用tokenStore 获取相关信息
根据客户端信息获取access_token 
OAuth2AccessToken token = resourceServerTokenServices.readAccessToken(value);
根据token获取用户信息
OAuth2Authentication authentication = resourceServerTokenServices.loadAuthentication(token.getValue());
  1. 资源服务器通过userDetailService根据/oauth/check_token返回的username获取用户详细信息


    image.png

二、 授权服务器 /oauth/token获取access_token的流程


image.png

image.png
oauthtoken接口流程分析.png

你可能感兴趣的:(spring security oauth)