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

所有已知实现类:
InMemoryTokenStore, JdbcTokenStore

public interface TokenStore

Persistence interface for OAuth2 tokens.


方法摘要
 Collection<OAuth2AccessToken> findTokensByClientId(String clientId)
           
 Collection<OAuth2AccessToken> findTokensByUserName(String userName)
           
 OAuth2AccessToken getAccessToken(OAuth2Authentication authentication)
          Retrieve an access token stored against the provided authentication key, if it exists.
 OAuth2AccessToken readAccessToken(String tokenValue)
          Read an access token from the store.
 OAuth2Authentication readAuthentication(OAuth2AccessToken token)
          Read the authentication stored under the specified token value.
 OAuth2Authentication readAuthentication(String token)
          Read the authentication stored under the specified token value.
 OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken token)
           
 OAuth2RefreshToken readRefreshToken(String tokenValue)
          Read a refresh token from the store.
 void removeAccessToken(OAuth2AccessToken token)
          Remove an access token from the database.
 void removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken)
          Remove an access token using a refresh token.
 void removeRefreshToken(OAuth2RefreshToken token)
          Remove a refresh token from the database.
 void storeAccessToken(OAuth2AccessToken token, OAuth2Authentication authentication)
          Store an access token.
 void storeRefreshToken(OAuth2RefreshToken refreshToken, OAuth2Authentication authentication)
          Store the specified refresh token in the database.
 

方法详细信息

readAuthentication

OAuth2Authentication readAuthentication(OAuth2AccessToken token)
Read the authentication stored under the specified token value.

参数:
token - The token value under which the authentication is stored.
返回:
The authentication, or null if none.

readAuthentication

OAuth2Authentication readAuthentication(String token)
Read the authentication stored under the specified token value.

参数:
token - The token value under which the authentication is stored.
返回:
The authentication, or null if none.

storeAccessToken

void storeAccessToken(OAuth2AccessToken token,
                      OAuth2Authentication authentication)
Store an access token.

参数:
token - The token to store.
authentication - The authentication associated with the token.

readAccessToken

OAuth2AccessToken readAccessToken(String tokenValue)
Read an access token from the store.

参数:
tokenValue - The token value.
返回:
The access token to read.

removeAccessToken

void removeAccessToken(OAuth2AccessToken token)
Remove an access token from the database.

参数:
token - The token to remove from the database.

storeRefreshToken

void storeRefreshToken(OAuth2RefreshToken refreshToken,
                       OAuth2Authentication authentication)
Store the specified refresh token in the database.

参数:
refreshToken - The refresh token to store.
authentication - The authentication associated with the refresh token.

readRefreshToken

OAuth2RefreshToken readRefreshToken(String tokenValue)
Read a refresh token from the store.

参数:
tokenValue - The value of the token to read.
返回:
The token.

readAuthenticationForRefreshToken

OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken token)
参数:
token - a refresh token
返回:
the authentication originally used to grant the refresh token

removeRefreshToken

void removeRefreshToken(OAuth2RefreshToken token)
Remove a refresh token from the database.

参数:
token - The token to remove from the database.

removeAccessTokenUsingRefreshToken

void removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken)
Remove an access token using a refresh token. This functionality is necessary so refresh tokens can't be used to create an unlimited number of access tokens.

参数:
refreshToken - The refresh token.

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

findTokensByUserName

Collection<OAuth2AccessToken> findTokensByUserName(String userName)
参数:
userName - the user name to search
返回:
a collection of access tokens

findTokensByClientId

Collection<OAuth2AccessToken> findTokensByClientId(String clientId)
参数:
clientId - the client id
返回:
a collection of access tokens


Copyright © 2013. All rights reserved.