2022-03-20 23:53:34 +08:00
|
|
|
` 有来 Spring Security OAuth2 刷新模式
|
|
|
|
@startuml
|
|
|
|
'https://plantuml.com/sequence-diagram
|
|
|
|
skinparam backgroundColor #EEEBDC
|
|
|
|
skinparam handwritten true
|
|
|
|
|
2022-12-11 10:35:23 +08:00
|
|
|
header @有来技术 Spring Security OAuth2 刷新模式
|
2022-03-20 23:53:34 +08:00
|
|
|
|
|
|
|
actor 客户端
|
|
|
|
|
|
|
|
客户端 -> AuthController: 刷新模式 \n /oauth/token?gran_type=refresh_token
|
|
|
|
AuthController -> TokenEndpoint: postAccessToken()
|
|
|
|
TokenEndpoint -> CompositeTokenGranter: this.getTokenGranter().grant()
|
|
|
|
CompositeTokenGranter->RefreshTokenGranter:grant( grantType, tokenRequest )\n根据 grant_type 匹配 Granter
|
|
|
|
note over of AuthenticationManagerDelegator #aqua
|
|
|
|
WebSecurityConfigurerAdapter 内部类
|
|
|
|
end note
|
|
|
|
RefreshTokenGranter-> AuthenticationManagerDelegator:this.authenticationManager.authenticate()
|
|
|
|
AuthenticationManagerDelegator -> ProviderManager: this.delegate.authenticate()
|
|
|
|
|
|
|
|
|
|
|
|
ProviderManager -> ProviderManager: 匹配支持\nPreAuthenticatedAuthenticationToken\n的Provider
|
|
|
|
activate ProviderManager
|
|
|
|
ProviderManager -> PreAuthenticatedAuthenticationProvider: provider.authenticate(authentication)
|
|
|
|
deactivate ProviderManager
|
|
|
|
PreAuthenticatedAuthenticationProvider -> PreAuthenticatedAuthenticationProvider:authenticate()\n用户校验\n是否锁定\n是否有效\n是否过期
|
|
|
|
ProviderManager <-- PreAuthenticatedAuthenticationProvider: Authentication
|
|
|
|
AuthenticationManagerDelegator <-- ProviderManager: Authentication
|
|
|
|
RefreshTokenGranter <-- AuthenticationManagerDelegator: OAuth2Authentication
|
2022-09-25 15:48:57 +08:00
|
|
|
CompositeTokenGranter <-- RefreshTokenGranter: OAuth2Authentication
|
2022-03-20 23:53:34 +08:00
|
|
|
TokenEndpoint <-- CompositeTokenGranter:OAuth2AccessToken
|
|
|
|
AuthController <-- TokenEndpoint:OAuth2AccessToken
|
|
|
|
客户端 <-- AuthController: OAuth2AccessToken
|
|
|
|
@enduml
|