

id和-secret,用于设置一对ResourceServer 用来认证的Authorization Server的clientid和client secret

OAuth2ClientAuthenticationProcessingFilter AbstractSecurityInterceptor#befroeInvaction 是ResourceServer获取认证信息的地方Īccess-token-uri: user-authorization-uri: use-current-uri: trueĬlient里面的配置最终是用来生成OAuth2ProtectedResourceDetails的bean的,参看OAuth2ProtectedResourceDetailsConfiguration or EnableOAuth2Sso.OAuth2ClientAuthenticationProcessingFilter:OAuth2客户端用来从OAuth2认证服务器获取access token,也可以从OAuth2认证服务器加载authentication对象到OAuth2客户端的Securit圜ontext对象中;里面调用OAuth2AuthenticationManager#authenticate()方法使用DefaultTokenServices ,DefaultTokenServices 使用JwtTokenStore,JwtTokenStore使用JwtAccessTokenConverter来将JWT解密成Auth对象。 来从AuthServer请求授权信息 ClientCredentialsTokenEndpointFilter用来验证clientId和clientsecret的:.每一个ResourceServer在配置的时候,ResourceServerConfiguration,需要配置一个resourceID,一个ResourceServer只能配置一个.Since some OAuth authorization grants don’t require user authentication, the user authentication may be null. An OAuth 2 authentication token can contain two authentications: one for the client(OAuth2 Client) and one for the user.BearerTokenExtractor,从其可以看出,token的获取顺序,Header,parameters(get/post).


