org.springframework.security.oauth2.client.token
类 AccessTokenProviderChain
java.lang.Object
org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport
org.springframework.security.oauth2.client.token.AccessTokenProviderChain
- 所有已实现的接口:
- AccessTokenProvider
public class AccessTokenProviderChain
- extends OAuth2AccessTokenSupport
- implements AccessTokenProvider
A chain of OAuth2 access token providers. This implementation will iterate through its chain to find the first
provider that supports the resource and use it to obtain the access token. Note that the order of the chain is
relevant.
- 作者:
- Ryan Heaton, Dave Syer
| 从类 org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport 继承的方法 |
getAccessTokenUri, getHttpMethod, getRequestCallback, getResponseErrorHandler, getResponseExtractor, getRestTemplate, retrieveToken, setAuthenticationHandler, setInterceptors, setMessageConverters, setRequestFactory |
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AccessTokenProviderChain
public AccessTokenProviderChain(List<? extends AccessTokenProvider> chain)
setClientTokenServices
public void setClientTokenServices(ClientTokenServices clientTokenServices)
- Token services for long-term persistence of access tokens.
- 参数:
clientTokenServices - the clientTokenServices to set
supportsResource
public boolean supportsResource(OAuth2ProtectedResourceDetails resource)
- 从接口
AccessTokenProvider 复制的描述
- Whether this provider supports the specified resource.
- 指定者:
- 接口
AccessTokenProvider 中的 supportsResource
- 参数:
resource - The resource.
- 返回:
- Whether this provider supports the specified resource.
supportsRefresh
public boolean supportsRefresh(OAuth2ProtectedResourceDetails resource)
- 指定者:
- 接口
AccessTokenProvider 中的 supportsRefresh
- 参数:
resource - The resource to check
- 返回:
- true if this provider can refresh an access token
obtainAccessToken
public OAuth2AccessToken obtainAccessToken(OAuth2ProtectedResourceDetails resource,
AccessTokenRequest request)
throws UserRedirectRequiredException,
org.springframework.security.access.AccessDeniedException
- 从接口
AccessTokenProvider 复制的描述
- Obtain a new access token for the specified protected resource.
- 指定者:
- 接口
AccessTokenProvider 中的 obtainAccessToken
- 参数:
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.
- 返回:
- The access token for the specified protected resource. The return value may NOT be null.
- 抛出:
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.
obtainNewAccessTokenInternal
protected OAuth2AccessToken obtainNewAccessTokenInternal(OAuth2ProtectedResourceDetails details,
AccessTokenRequest request)
throws UserRedirectRequiredException,
org.springframework.security.access.AccessDeniedException
- 抛出:
UserRedirectRequiredException
org.springframework.security.access.AccessDeniedException
refreshAccessToken
public OAuth2AccessToken refreshAccessToken(OAuth2ProtectedResourceDetails resource,
OAuth2RefreshToken refreshToken,
AccessTokenRequest request)
throws UserRedirectRequiredException
- Obtain a new access token for the specified resource using the refresh token.
- 指定者:
- 接口
AccessTokenProvider 中的 refreshAccessToken
- 参数:
resource - The resource.refreshToken - The refresh token.
- 返回:
- The access token, or null if failed.
- 抛出:
UserRedirectRequiredException
Copyright © 2013. All rights reserved.