org.springframework.security.oauth2.provider.token
接口 AuthorizationServerTokenServices

所有已知实现类:
DefaultTokenServices

public interface AuthorizationServerTokenServices

作者:
Ryan Heaton, Dave Syer

方法摘要
 OAuth2AccessToken createAccessToken(OAuth2Authentication authentication)
          Create an access token associated with the specified credentials.
 OAuth2AccessToken getAccessToken(OAuth2Authentication authentication)
          Retrieve an access token stored against the provided authentication key, if it exists.
 OAuth2AccessToken refreshAccessToken(String refreshToken, TokenRequest tokenRequest)
          Refresh an access token.
 

方法详细信息

createAccessToken

OAuth2AccessToken createAccessToken(OAuth2Authentication authentication)
                                    throws org.springframework.security.core.AuthenticationException
Create an access token associated with the specified credentials.

参数:
authentication - The credentials associated with the access token.
返回:
The access token.
抛出:
org.springframework.security.core.AuthenticationException - If the credentials are inadequate.

refreshAccessToken

OAuth2AccessToken refreshAccessToken(String refreshToken,
                                     TokenRequest tokenRequest)
                                     throws org.springframework.security.core.AuthenticationException
Refresh an access token. The authorization request should be used for 2 things (at least): to validate that the client id of the original access token is the same as the one requesting the refresh, and to narrow the scopes (if provided).

参数:
refreshToken - The details about the refresh token.
tokenRequest - The incoming token request.
返回:
The (new) access token.
抛出:
org.springframework.security.core.AuthenticationException - If the refresh token is invalid or expired.

getAccessToken

OAuth2AccessToken getAccessToken(OAuth2Authentication authentication)
Retrieve an access token stored against the provided authentication key, if it exists.

参数:
authentication - the authentication key for the access token
返回:
the access token or null if there was none


Copyright © 2013. All rights reserved.