public class CustomInMemoryTokenStore
extends java.lang.Object
implements org.springframework.security.oauth2.provider.token.TokenStore
| Constructor and Description |
|---|
CustomInMemoryTokenStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Convenience method for super admin users to remove all tokens (useful for testing, not really in production)
|
java.util.Collection<org.springframework.security.oauth2.common.OAuth2AccessToken> |
findTokensByClientId(java.lang.String clientId) |
java.util.Collection<org.springframework.security.oauth2.common.OAuth2AccessToken> |
findTokensByClientIdAndUserName(java.lang.String clientId,
java.lang.String userName) |
org.springframework.security.oauth2.common.OAuth2AccessToken |
getAccessToken(org.springframework.security.oauth2.provider.OAuth2Authentication authentication) |
int |
getAccessTokenCount() |
int |
getExpiryTokenCount() |
int |
getFlushInterval()
The interval (count of token inserts) between flushing expired tokens.
|
int |
getRefreshTokenCount() |
org.springframework.security.oauth2.common.OAuth2AccessToken |
readAccessToken(java.lang.String tokenValue) |
java.lang.String |
readAccessTokenToClientKey(java.lang.String tokenValue)
根据token读取对应的私钥
|
org.springframework.security.oauth2.provider.OAuth2Authentication |
readAuthentication(org.springframework.security.oauth2.common.OAuth2AccessToken token) |
org.springframework.security.oauth2.provider.OAuth2Authentication |
readAuthentication(java.lang.String token) |
org.springframework.security.oauth2.provider.OAuth2Authentication |
readAuthenticationForRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken token) |
org.springframework.security.oauth2.provider.OAuth2Authentication |
readAuthenticationForRefreshToken(java.lang.String token) |
org.springframework.security.oauth2.common.OAuth2RefreshToken |
readRefreshToken(java.lang.String tokenValue) |
void |
removeAccessToken(org.springframework.security.oauth2.common.OAuth2AccessToken accessToken) |
void |
removeAccessToken(java.lang.String tokenValue) |
void |
removeAccessTokenUsingRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken refreshToken) |
void |
removeRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken refreshToken) |
void |
removeRefreshToken(java.lang.String tokenValue) |
void |
setAuthenticationKeyGenerator(org.springframework.security.oauth2.provider.token.AuthenticationKeyGenerator authenticationKeyGenerator) |
void |
setFlushInterval(int flushInterval)
The number of tokens to store before flushing expired tokens.
|
void |
storeAccessToken(org.springframework.security.oauth2.common.OAuth2AccessToken token,
org.springframework.security.oauth2.provider.OAuth2Authentication authentication) |
void |
storeRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken refreshToken,
org.springframework.security.oauth2.provider.OAuth2Authentication authentication) |
public void setFlushInterval(int flushInterval)
flushInterval - the interval to setpublic int getFlushInterval()
public void clear()
public void setAuthenticationKeyGenerator(org.springframework.security.oauth2.provider.token.AuthenticationKeyGenerator authenticationKeyGenerator)
public int getAccessTokenCount()
public int getRefreshTokenCount()
public int getExpiryTokenCount()
public org.springframework.security.oauth2.common.OAuth2AccessToken getAccessToken(org.springframework.security.oauth2.provider.OAuth2Authentication authentication)
getAccessToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic org.springframework.security.oauth2.provider.OAuth2Authentication readAuthentication(org.springframework.security.oauth2.common.OAuth2AccessToken token)
readAuthentication in interface org.springframework.security.oauth2.provider.token.TokenStorepublic org.springframework.security.oauth2.provider.OAuth2Authentication readAuthentication(java.lang.String token)
readAuthentication in interface org.springframework.security.oauth2.provider.token.TokenStorepublic org.springframework.security.oauth2.provider.OAuth2Authentication readAuthenticationForRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken token)
readAuthenticationForRefreshToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic org.springframework.security.oauth2.provider.OAuth2Authentication readAuthenticationForRefreshToken(java.lang.String token)
public void storeAccessToken(org.springframework.security.oauth2.common.OAuth2AccessToken token,
org.springframework.security.oauth2.provider.OAuth2Authentication authentication)
storeAccessToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic void removeAccessToken(org.springframework.security.oauth2.common.OAuth2AccessToken accessToken)
removeAccessToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic org.springframework.security.oauth2.common.OAuth2AccessToken readAccessToken(java.lang.String tokenValue)
readAccessToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic java.lang.String readAccessTokenToClientKey(java.lang.String tokenValue)
tokenValue - token值public void removeAccessToken(java.lang.String tokenValue)
public void storeRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken refreshToken,
org.springframework.security.oauth2.provider.OAuth2Authentication authentication)
storeRefreshToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic org.springframework.security.oauth2.common.OAuth2RefreshToken readRefreshToken(java.lang.String tokenValue)
readRefreshToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic void removeRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken refreshToken)
removeRefreshToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic void removeRefreshToken(java.lang.String tokenValue)
public void removeAccessTokenUsingRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken refreshToken)
removeAccessTokenUsingRefreshToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic java.util.Collection<org.springframework.security.oauth2.common.OAuth2AccessToken> findTokensByClientIdAndUserName(java.lang.String clientId,
java.lang.String userName)
findTokensByClientIdAndUserName in interface org.springframework.security.oauth2.provider.token.TokenStorepublic java.util.Collection<org.springframework.security.oauth2.common.OAuth2AccessToken> findTokensByClientId(java.lang.String clientId)
findTokensByClientId in interface org.springframework.security.oauth2.provider.token.TokenStore