public class MongoTokenStore extends Object implements org.springframework.security.oauth2.provider.token.TokenStore, org.springframework.beans.factory.InitializingBean
| Constructor and Description |
|---|
MongoTokenStore(com.mongodb.DB db) |
MongoTokenStore(com.mongodb.Mongo mongo,
String databaseName) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected org.springframework.security.oauth2.common.OAuth2AccessToken |
deserializeAccessToken(byte[] token) |
protected org.springframework.security.oauth2.provider.OAuth2Authentication |
deserializeAuthentication(byte[] authentication) |
protected org.springframework.security.oauth2.common.OAuth2RefreshToken |
deserializeRefreshToken(byte[] token) |
protected String |
extractTokenKey(String value) |
Collection<org.springframework.security.oauth2.common.OAuth2AccessToken> |
findTokensByClientId(String clientId) |
Collection<org.springframework.security.oauth2.common.OAuth2AccessToken> |
findTokensByClientIdAndUserName(String clientId,
String userName) |
Collection<org.springframework.security.oauth2.common.OAuth2AccessToken> |
findTokensByUserName(String userName) |
org.springframework.security.oauth2.common.OAuth2AccessToken |
getAccessToken(org.springframework.security.oauth2.provider.OAuth2Authentication authentication) |
org.springframework.security.oauth2.common.OAuth2AccessToken |
readAccessToken(String tokenValue) |
org.springframework.security.oauth2.provider.OAuth2Authentication |
readAuthentication(org.springframework.security.oauth2.common.OAuth2AccessToken token) |
org.springframework.security.oauth2.provider.OAuth2Authentication |
readAuthentication(String token) |
org.springframework.security.oauth2.provider.OAuth2Authentication |
readAuthenticationForRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken token) |
org.springframework.security.oauth2.provider.OAuth2Authentication |
readAuthenticationForRefreshToken(String value) |
org.springframework.security.oauth2.common.OAuth2RefreshToken |
readRefreshToken(String token) |
void |
removeAccessToken(org.springframework.security.oauth2.common.OAuth2AccessToken token) |
void |
removeAccessToken(String tokenValue) |
void |
removeAccessTokenUsingRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken refreshToken) |
void |
removeAccessTokenUsingRefreshToken(String refreshToken) |
void |
removeRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken token) |
void |
removeRefreshToken(String token) |
protected byte[] |
serializeAccessToken(org.springframework.security.oauth2.common.OAuth2AccessToken token) |
protected byte[] |
serializeAuthentication(org.springframework.security.oauth2.provider.OAuth2Authentication authentication) |
protected byte[] |
serializeRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken token) |
void |
setAccessTokenCollectionName(String accessTokenCollectionName) |
void |
setAuthenticationFieldName(String authenticationFieldName) |
void |
setAuthenticationIdFieldName(String authenticationIdFieldName) |
void |
setAuthenticationKeyGenerator(org.springframework.security.oauth2.provider.token.AuthenticationKeyGenerator authenticationKeyGenerator) |
void |
setClientIdFieldName(String clientIdFieldName) |
void |
setRefreshTokenCollectionName(String refreshTokenCollectionName) |
void |
setRefreshTokenFieldName(String refreshTokenFieldName) |
void |
setTokenFieldName(String tokenFieldName) |
void |
setTokenIdFieldName(String tokenIdFieldName) |
void |
setUsernameFieldName(String usernameFieldName) |
void |
setWriteConcern(com.mongodb.WriteConcern writeConcern) |
void |
storeAccessToken(org.springframework.security.oauth2.common.OAuth2AccessToken accessToken,
org.springframework.security.oauth2.provider.OAuth2Authentication authentication) |
void |
storeRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken refreshToken,
org.springframework.security.oauth2.provider.OAuth2Authentication authentication) |
public MongoTokenStore(com.mongodb.Mongo mongo,
String databaseName)
public MongoTokenStore(com.mongodb.DB db)
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic org.springframework.security.oauth2.common.OAuth2AccessToken getAccessToken(org.springframework.security.oauth2.provider.OAuth2Authentication authentication)
getAccessToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic void storeAccessToken(org.springframework.security.oauth2.common.OAuth2AccessToken accessToken,
org.springframework.security.oauth2.provider.OAuth2Authentication authentication)
storeAccessToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic org.springframework.security.oauth2.common.OAuth2AccessToken readAccessToken(String tokenValue)
readAccessToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic void removeAccessToken(org.springframework.security.oauth2.common.OAuth2AccessToken token)
removeAccessToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic void removeAccessToken(String tokenValue)
public 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(String token)
readAuthentication in interface org.springframework.security.oauth2.provider.token.TokenStorepublic 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(String token)
readRefreshToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic void removeRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken token)
removeRefreshToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic void removeRefreshToken(String token)
public 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(String value)
public void removeAccessTokenUsingRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken refreshToken)
removeAccessTokenUsingRefreshToken in interface org.springframework.security.oauth2.provider.token.TokenStorepublic void removeAccessTokenUsingRefreshToken(String refreshToken)
public Collection<org.springframework.security.oauth2.common.OAuth2AccessToken> findTokensByClientId(String clientId)
findTokensByClientId in interface org.springframework.security.oauth2.provider.token.TokenStorepublic Collection<org.springframework.security.oauth2.common.OAuth2AccessToken> findTokensByUserName(String userName)
public Collection<org.springframework.security.oauth2.common.OAuth2AccessToken> findTokensByClientIdAndUserName(String clientId, String userName)
findTokensByClientIdAndUserName in interface org.springframework.security.oauth2.provider.token.TokenStoreprotected byte[] serializeAccessToken(org.springframework.security.oauth2.common.OAuth2AccessToken token)
protected byte[] serializeRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken token)
protected byte[] serializeAuthentication(org.springframework.security.oauth2.provider.OAuth2Authentication authentication)
protected org.springframework.security.oauth2.common.OAuth2AccessToken deserializeAccessToken(byte[] token)
protected org.springframework.security.oauth2.common.OAuth2RefreshToken deserializeRefreshToken(byte[] token)
protected org.springframework.security.oauth2.provider.OAuth2Authentication deserializeAuthentication(byte[] authentication)
public void setAuthenticationKeyGenerator(org.springframework.security.oauth2.provider.token.AuthenticationKeyGenerator authenticationKeyGenerator)
public void setAccessTokenCollectionName(String accessTokenCollectionName)
public void setRefreshTokenCollectionName(String refreshTokenCollectionName)
public void setTokenIdFieldName(String tokenIdFieldName)
public void setTokenFieldName(String tokenFieldName)
public void setAuthenticationIdFieldName(String authenticationIdFieldName)
public void setUsernameFieldName(String usernameFieldName)
public void setClientIdFieldName(String clientIdFieldName)
public void setAuthenticationFieldName(String authenticationFieldName)
public void setRefreshTokenFieldName(String refreshTokenFieldName)
public void setWriteConcern(com.mongodb.WriteConcern writeConcern)
Copyright © 2015 Pivotal Software, Inc.. All rights reserved.