org.springframework.security.oauth2.provider.token
类 JdbcTokenStore

java.lang.Object
  继承者 org.springframework.security.oauth2.provider.token.JdbcTokenStore
所有已实现的接口:
TokenStore

public class JdbcTokenStore
extends Object
implements TokenStore

Implementation of token services that stores tokens in a database.

作者:
Ken Dombeck, Luke Taylor, Dave Syer

构造方法摘要
JdbcTokenStore(DataSource dataSource)
           
 
方法摘要
protected  OAuth2AccessToken deserializeAccessToken(byte[] token)
           
protected  OAuth2Authentication deserializeAuthentication(byte[] authentication)
           
protected  OAuth2RefreshToken deserializeRefreshToken(byte[] token)
           
protected  String extractTokenKey(String value)
           
 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)
           
 OAuth2Authentication readAuthenticationForRefreshToken(String value)
           
 OAuth2RefreshToken readRefreshToken(String token)
          Read a refresh token from the store.
 void removeAccessToken(OAuth2AccessToken token)
          Remove an access token from the database.
 void removeAccessToken(String tokenValue)
           
 void removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken)
          Remove an access token using a refresh token.
 void removeAccessTokenUsingRefreshToken(String refreshToken)
           
 void removeRefreshToken(OAuth2RefreshToken token)
          Remove a refresh token from the database.
 void removeRefreshToken(String token)
           
protected  byte[] serializeAccessToken(OAuth2AccessToken token)
           
protected  byte[] serializeAuthentication(OAuth2Authentication authentication)
           
protected  byte[] serializeRefreshToken(OAuth2RefreshToken token)
           
 void setAuthenticationKeyGenerator(AuthenticationKeyGenerator authenticationKeyGenerator)
           
 void setDeleteAccessTokenFromRefreshTokenSql(String deleteAccessTokenFromRefreshTokenSql)
           
 void setDeleteAccessTokenSql(String deleteAccessTokenSql)
           
 void setDeleteRefreshTokenSql(String deleteRefreshTokenSql)
           
 void setInsertAccessTokenSql(String insertAccessTokenSql)
           
 void setInsertRefreshTokenSql(String insertRefreshTokenSql)
           
 void setSelectAccessTokenAuthenticationSql(String selectAccessTokenAuthenticationSql)
           
 void setSelectAccessTokenFromAuthenticationSql(String selectAccessTokenFromAuthenticationSql)
           
 void setSelectAccessTokenSql(String selectAccessTokenSql)
           
 void setSelectRefreshTokenAuthenticationSql(String selectRefreshTokenAuthenticationSql)
           
 void setSelectRefreshTokenSql(String selectRefreshTokenSql)
           
 void storeAccessToken(OAuth2AccessToken token, OAuth2Authentication authentication)
          Store an access token.
 void storeRefreshToken(OAuth2RefreshToken refreshToken, OAuth2Authentication authentication)
          Store the specified refresh token in the database.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

JdbcTokenStore

public JdbcTokenStore(DataSource dataSource)
方法详细信息

setAuthenticationKeyGenerator

public void setAuthenticationKeyGenerator(AuthenticationKeyGenerator authenticationKeyGenerator)

getAccessToken

public OAuth2AccessToken getAccessToken(OAuth2Authentication authentication)
从接口 TokenStore 复制的描述
Retrieve an access token stored against the provided authentication key, if it exists.

指定者:
接口 TokenStore 中的 getAccessToken
参数:
authentication - the authentication key for the access token
返回:
the access token or null if there was none

storeAccessToken

public void storeAccessToken(OAuth2AccessToken token,
                             OAuth2Authentication authentication)
从接口 TokenStore 复制的描述
Store an access token.

指定者:
接口 TokenStore 中的 storeAccessToken
参数:
token - The token to store.
authentication - The authentication associated with the token.

readAccessToken

public OAuth2AccessToken readAccessToken(String tokenValue)
从接口 TokenStore 复制的描述
Read an access token from the store.

指定者:
接口 TokenStore 中的 readAccessToken
参数:
tokenValue - The token value.
返回:
The access token to read.

removeAccessToken

public void removeAccessToken(OAuth2AccessToken token)
从接口 TokenStore 复制的描述
Remove an access token from the database.

指定者:
接口 TokenStore 中的 removeAccessToken
参数:
token - The token to remove from the database.

removeAccessToken

public void removeAccessToken(String tokenValue)

readAuthentication

public OAuth2Authentication readAuthentication(OAuth2AccessToken token)
从接口 TokenStore 复制的描述
Read the authentication stored under the specified token value.

指定者:
接口 TokenStore 中的 readAuthentication
参数:
token - The token value under which the authentication is stored.
返回:
The authentication, or null if none.

readAuthentication

public OAuth2Authentication readAuthentication(String token)
从接口 TokenStore 复制的描述
Read the authentication stored under the specified token value.

指定者:
接口 TokenStore 中的 readAuthentication
参数:
token - The token value under which the authentication is stored.
返回:
The authentication, or null if none.

storeRefreshToken

public void storeRefreshToken(OAuth2RefreshToken refreshToken,
                              OAuth2Authentication authentication)
从接口 TokenStore 复制的描述
Store the specified refresh token in the database.

指定者:
接口 TokenStore 中的 storeRefreshToken
参数:
refreshToken - The refresh token to store.
authentication - The authentication associated with the refresh token.

readRefreshToken

public OAuth2RefreshToken readRefreshToken(String token)
从接口 TokenStore 复制的描述
Read a refresh token from the store.

指定者:
接口 TokenStore 中的 readRefreshToken
参数:
token - The value of the token to read.
返回:
The token.

removeRefreshToken

public void removeRefreshToken(OAuth2RefreshToken token)
从接口 TokenStore 复制的描述
Remove a refresh token from the database.

指定者:
接口 TokenStore 中的 removeRefreshToken
参数:
token - The token to remove from the database.

removeRefreshToken

public void removeRefreshToken(String token)

readAuthenticationForRefreshToken

public OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken token)
指定者:
接口 TokenStore 中的 readAuthenticationForRefreshToken
参数:
token - a refresh token
返回:
the authentication originally used to grant the refresh token

readAuthenticationForRefreshToken

public OAuth2Authentication readAuthenticationForRefreshToken(String value)

removeAccessTokenUsingRefreshToken

public void removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken)
从接口 TokenStore 复制的描述
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.

指定者:
接口 TokenStore 中的 removeAccessTokenUsingRefreshToken
参数:
refreshToken - The refresh token.

removeAccessTokenUsingRefreshToken

public void removeAccessTokenUsingRefreshToken(String refreshToken)

findTokensByClientId

public Collection<OAuth2AccessToken> findTokensByClientId(String clientId)
指定者:
接口 TokenStore 中的 findTokensByClientId
参数:
clientId - the client id
返回:
a collection of access tokens

findTokensByUserName

public Collection<OAuth2AccessToken> findTokensByUserName(String userName)
指定者:
接口 TokenStore 中的 findTokensByUserName
参数:
userName - the user name to search
返回:
a collection of access tokens

extractTokenKey

protected String extractTokenKey(String value)

serializeAccessToken

protected byte[] serializeAccessToken(OAuth2AccessToken token)

serializeRefreshToken

protected byte[] serializeRefreshToken(OAuth2RefreshToken token)

serializeAuthentication

protected byte[] serializeAuthentication(OAuth2Authentication authentication)

deserializeAccessToken

protected OAuth2AccessToken deserializeAccessToken(byte[] token)

deserializeRefreshToken

protected OAuth2RefreshToken deserializeRefreshToken(byte[] token)

deserializeAuthentication

protected OAuth2Authentication deserializeAuthentication(byte[] authentication)

setInsertAccessTokenSql

public void setInsertAccessTokenSql(String insertAccessTokenSql)

setSelectAccessTokenSql

public void setSelectAccessTokenSql(String selectAccessTokenSql)

setDeleteAccessTokenSql

public void setDeleteAccessTokenSql(String deleteAccessTokenSql)

setInsertRefreshTokenSql

public void setInsertRefreshTokenSql(String insertRefreshTokenSql)

setSelectRefreshTokenSql

public void setSelectRefreshTokenSql(String selectRefreshTokenSql)

setDeleteRefreshTokenSql

public void setDeleteRefreshTokenSql(String deleteRefreshTokenSql)

setSelectAccessTokenAuthenticationSql

public void setSelectAccessTokenAuthenticationSql(String selectAccessTokenAuthenticationSql)

setSelectRefreshTokenAuthenticationSql

public void setSelectRefreshTokenAuthenticationSql(String selectRefreshTokenAuthenticationSql)

setSelectAccessTokenFromAuthenticationSql

public void setSelectAccessTokenFromAuthenticationSql(String selectAccessTokenFromAuthenticationSql)

setDeleteAccessTokenFromRefreshTokenSql

public void setDeleteAccessTokenFromRefreshTokenSql(String deleteAccessTokenFromRefreshTokenSql)


Copyright © 2013. All rights reserved.