public class AccessTokenProviderChain extends OAuth2AccessTokenSupport implements AccessTokenProvider
logger
Constructor and Description |
---|
AccessTokenProviderChain(List<? extends AccessTokenProvider> chain) |
Modifier and Type | Method and Description |
---|---|
OAuth2AccessToken |
obtainAccessToken(OAuth2ProtectedResourceDetails resource,
AccessTokenRequest request)
Obtain a new access token for the specified protected resource.
|
protected OAuth2AccessToken |
obtainNewAccessTokenInternal(OAuth2ProtectedResourceDetails details,
AccessTokenRequest request) |
OAuth2AccessToken |
refreshAccessToken(OAuth2ProtectedResourceDetails resource,
OAuth2RefreshToken refreshToken,
AccessTokenRequest request)
Obtain a new access token for the specified resource using the refresh token.
|
void |
setClientTokenServices(ClientTokenServices clientTokenServices)
Token services for long-term persistence of access tokens.
|
boolean |
supportsRefresh(OAuth2ProtectedResourceDetails resource) |
boolean |
supportsResource(OAuth2ProtectedResourceDetails resource)
Whether this provider supports the specified resource.
|
getAccessTokenUri, getHttpMethod, getRequestCallback, getResponseErrorHandler, getResponseExtractor, getRestTemplate, retrieveToken, setAuthenticationHandler, setInterceptors, setMessageConverters, setRequestFactory, setTokenRequestEnhancer
public AccessTokenProviderChain(List<? extends AccessTokenProvider> chain)
public void setClientTokenServices(ClientTokenServices clientTokenServices)
clientTokenServices
- the clientTokenServices to setpublic boolean supportsResource(OAuth2ProtectedResourceDetails resource)
AccessTokenProvider
supportsResource
in interface AccessTokenProvider
resource
- The resource.public boolean supportsRefresh(OAuth2ProtectedResourceDetails resource)
supportsRefresh
in interface AccessTokenProvider
resource
- The resource to checkpublic OAuth2AccessToken obtainAccessToken(OAuth2ProtectedResourceDetails resource, AccessTokenRequest request) throws UserRedirectRequiredException, org.springframework.security.access.AccessDeniedException
AccessTokenProvider
obtainAccessToken
in interface AccessTokenProvider
resource
- The protected resource for which this provider is to obtain an access token.request
- The parameters of the request giving context for the token details if any.UserRedirectRequiredException
- If the provider requires the current user to be redirected for
authorization.org.springframework.security.access.AccessDeniedException
- If the user denies access to the protected resource.protected OAuth2AccessToken obtainNewAccessTokenInternal(OAuth2ProtectedResourceDetails details, AccessTokenRequest request) throws UserRedirectRequiredException, org.springframework.security.access.AccessDeniedException
UserRedirectRequiredException
org.springframework.security.access.AccessDeniedException
public OAuth2AccessToken refreshAccessToken(OAuth2ProtectedResourceDetails resource, OAuth2RefreshToken refreshToken, AccessTokenRequest request) throws UserRedirectRequiredException
refreshAccessToken
in interface AccessTokenProvider
resource
- The resource.refreshToken
- The refresh token.UserRedirectRequiredException
Copyright © 2019. All rights reserved.