public class JdbcTokenStore extends Object implements TokenStore
Constructor and Description |
---|
JdbcTokenStore(DataSource dataSource) |
public JdbcTokenStore(DataSource dataSource)
public void setAuthenticationKeyGenerator(AuthenticationKeyGenerator authenticationKeyGenerator)
public OAuth2AccessToken getAccessToken(OAuth2Authentication authentication)
TokenStore
getAccessToken
in interface TokenStore
authentication
- the authentication key for the access tokenpublic void storeAccessToken(OAuth2AccessToken token, OAuth2Authentication authentication)
TokenStore
storeAccessToken
in interface TokenStore
token
- The token to store.authentication
- The authentication associated with the token.public OAuth2AccessToken readAccessToken(String tokenValue)
TokenStore
readAccessToken
in interface TokenStore
tokenValue
- The token value.public void removeAccessToken(OAuth2AccessToken token)
TokenStore
removeAccessToken
in interface TokenStore
token
- The token to remove from the store.public void removeAccessToken(String tokenValue)
public OAuth2Authentication readAuthentication(OAuth2AccessToken token)
TokenStore
readAuthentication
in interface TokenStore
token
- The token value under which the authentication is stored.public OAuth2Authentication readAuthentication(String token)
TokenStore
readAuthentication
in interface TokenStore
token
- The token value under which the authentication is stored.public void storeRefreshToken(OAuth2RefreshToken refreshToken, OAuth2Authentication authentication)
TokenStore
storeRefreshToken
in interface TokenStore
refreshToken
- The refresh token to store.authentication
- The authentication associated with the refresh token.public OAuth2RefreshToken readRefreshToken(String token)
TokenStore
readRefreshToken
in interface TokenStore
token
- The value of the token to read.public void removeRefreshToken(OAuth2RefreshToken token)
TokenStore
removeRefreshToken
in interface TokenStore
token
- The token to remove from the store.public void removeRefreshToken(String token)
public OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken token)
readAuthenticationForRefreshToken
in interface TokenStore
token
- a refresh tokenpublic OAuth2Authentication readAuthenticationForRefreshToken(String value)
public void removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken)
TokenStore
removeAccessTokenUsingRefreshToken
in interface TokenStore
refreshToken
- The refresh token.public void removeAccessTokenUsingRefreshToken(String refreshToken)
public Collection<OAuth2AccessToken> findTokensByClientId(String clientId)
findTokensByClientId
in interface TokenStore
clientId
- the client id to searchpublic Collection<OAuth2AccessToken> findTokensByUserName(String userName)
public Collection<OAuth2AccessToken> findTokensByClientIdAndUserName(String clientId, String userName)
findTokensByClientIdAndUserName
in interface TokenStore
clientId
- the client id to searchuserName
- the user name to searchprotected byte[] serializeAccessToken(OAuth2AccessToken token)
protected byte[] serializeRefreshToken(OAuth2RefreshToken token)
protected byte[] serializeAuthentication(OAuth2Authentication authentication)
protected OAuth2AccessToken deserializeAccessToken(byte[] token)
protected OAuth2RefreshToken deserializeRefreshToken(byte[] token)
protected OAuth2Authentication deserializeAuthentication(byte[] authentication)
public void setInsertAccessTokenSql(String insertAccessTokenSql)
public void setSelectAccessTokenSql(String selectAccessTokenSql)
public void setDeleteAccessTokenSql(String deleteAccessTokenSql)
public void setInsertRefreshTokenSql(String insertRefreshTokenSql)
public void setSelectRefreshTokenSql(String selectRefreshTokenSql)
public void setDeleteRefreshTokenSql(String deleteRefreshTokenSql)
public void setSelectAccessTokenAuthenticationSql(String selectAccessTokenAuthenticationSql)
public void setSelectRefreshTokenAuthenticationSql(String selectRefreshTokenAuthenticationSql)
public void setSelectAccessTokenFromAuthenticationSql(String selectAccessTokenFromAuthenticationSql)
public void setDeleteAccessTokenFromRefreshTokenSql(String deleteAccessTokenFromRefreshTokenSql)
public void setSelectAccessTokensFromUserNameSql(String selectAccessTokensFromUserNameSql)
public void setSelectAccessTokensFromUserNameAndClientIdSql(String selectAccessTokensFromUserNameAndClientIdSql)
public void setSelectAccessTokensFromClientIdSql(String selectAccessTokensFromClientIdSql)
Copyright © 2019. All rights reserved.