|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.security.oauth2.provider.token.InMemoryTokenStore
public class InMemoryTokenStore
Implementation of token services that stores tokens in memory.
| Constructor Summary | |
|---|---|
InMemoryTokenStore()
|
|
| Method Summary | |
|---|---|
void |
clear()
Convenience method for super admin users to remove all tokens (useful for testing, not really in production) |
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. |
int |
getAccessTokenCount()
|
int |
getExpiryTokenCount()
|
int |
getFlushInterval()
The interval (count of token inserts) between flushing expired tokens. |
int |
getRefreshTokenCount()
|
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 token)
|
OAuth2RefreshToken |
readRefreshToken(String tokenValue)
Read a refresh token from the store. |
void |
removeAccessToken(OAuth2AccessToken accessToken)
Remove an access token from the database. |
void |
removeAccessToken(String tokenValue)
|
void |
removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken)
Remove an access token using a refresh token. |
void |
removeRefreshToken(OAuth2RefreshToken refreshToken)
Remove a refresh token from the database. |
void |
removeRefreshToken(String tokenValue)
|
void |
setAuthenticationKeyGenerator(AuthenticationKeyGenerator authenticationKeyGenerator)
|
void |
setFlushInterval(int flushInterval)
The number of tokens to store before flushing expired tokens. |
void |
storeAccessToken(OAuth2AccessToken token,
OAuth2Authentication authentication)
Store an access token. |
void |
storeRefreshToken(OAuth2RefreshToken refreshToken,
OAuth2Authentication authentication)
Store the specified refresh token in the database. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InMemoryTokenStore()
| Method Detail |
|---|
public void setFlushInterval(int flushInterval)
flushInterval - the interval to setpublic int getFlushInterval()
public void clear()
public void setAuthenticationKeyGenerator(AuthenticationKeyGenerator authenticationKeyGenerator)
public int getAccessTokenCount()
public int getRefreshTokenCount()
public int getExpiryTokenCount()
public OAuth2AccessToken getAccessToken(OAuth2Authentication authentication)
TokenStore
getAccessToken in interface TokenStoreauthentication - the authentication key for the access token
public OAuth2Authentication readAuthentication(OAuth2AccessToken token)
TokenStore
readAuthentication in interface TokenStoretoken - The token value under which the authentication is stored.
public OAuth2Authentication readAuthentication(String token)
TokenStore
readAuthentication in interface TokenStoretoken - The token value under which the authentication is stored.
public OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken token)
readAuthenticationForRefreshToken in interface TokenStoretoken - a refresh token
public OAuth2Authentication readAuthenticationForRefreshToken(String token)
public void storeAccessToken(OAuth2AccessToken token,
OAuth2Authentication authentication)
TokenStore
storeAccessToken in interface TokenStoretoken - The token to store.authentication - The authentication associated with the token.public void removeAccessToken(OAuth2AccessToken accessToken)
TokenStore
removeAccessToken in interface TokenStoreaccessToken - The token to remove from the database.public OAuth2AccessToken readAccessToken(String tokenValue)
TokenStore
readAccessToken in interface TokenStoretokenValue - The token value.
public void removeAccessToken(String tokenValue)
public void storeRefreshToken(OAuth2RefreshToken refreshToken,
OAuth2Authentication authentication)
TokenStore
storeRefreshToken in interface TokenStorerefreshToken - The refresh token to store.authentication - The authentication associated with the refresh token.public OAuth2RefreshToken readRefreshToken(String tokenValue)
TokenStore
readRefreshToken in interface TokenStoretokenValue - The value of the token to read.
public void removeRefreshToken(OAuth2RefreshToken refreshToken)
TokenStore
removeRefreshToken in interface TokenStorerefreshToken - The token to remove from the database.public void removeRefreshToken(String tokenValue)
public void removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken)
TokenStore
removeAccessTokenUsingRefreshToken in interface TokenStorerefreshToken - The refresh token.public Collection<OAuth2AccessToken> findTokensByClientId(String clientId)
findTokensByClientId in interface TokenStoreclientId - the client id
public Collection<OAuth2AccessToken> findTokensByUserName(String userName)
findTokensByUserName in interface TokenStoreuserName - the user name to search
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||