public class DefaultEHCacheOAuthDataProvider extends AbstractOAuthDataProvider
Modifier and Type | Field and Description |
---|---|
static String |
ACCESS_TOKEN_CACHE_KEY |
protected net.sf.ehcache.CacheManager |
cacheManager |
static String |
CLIENT_CACHE_KEY |
static String |
DEFAULT_CONFIG_URL |
static String |
REFRESH_TOKEN_CACHE_KEY |
Constructor and Description |
---|
DefaultEHCacheOAuthDataProvider() |
DefaultEHCacheOAuthDataProvider(String configFileURL,
Bus bus) |
DefaultEHCacheOAuthDataProvider(String configFileURL,
Bus bus,
String clientCacheKey,
String accessTokenCacheKey,
String refreshTokenCacheKey) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected static net.sf.ehcache.Ehcache |
createCache(net.sf.ehcache.CacheManager cacheManager,
String cacheKey) |
Client |
doGetClient(String clientId) |
protected void |
doRemoveClient(Client c) |
protected void |
doRevokeAccessToken(ServerAccessToken at) |
protected void |
doRevokeRefreshToken(RefreshToken rt) |
ServerAccessToken |
getAccessToken(String accessToken)
Get access token
|
List<ServerAccessToken> |
getAccessTokens(Client c,
UserSubject sub)
Return all access tokens associated with a given client
|
protected static <T> T |
getCacheValue(net.sf.ehcache.Ehcache cache,
String key,
Class<T> cls) |
List<Client> |
getClients(UserSubject resourceOwner)
Get a list of clients registered by a resource owner.
|
protected RefreshToken |
getRefreshToken(String refreshTokenKey) |
List<RefreshToken> |
getRefreshTokens(Client c,
UserSubject sub)
Return all refresh tokens associated with a given client
|
boolean |
isStoreJwtTokenKeyOnly() |
protected static void |
putCacheValue(net.sf.ehcache.Ehcache cache,
String key,
Object value,
long ttl) |
protected void |
saveAccessToken(ServerAccessToken serverToken) |
protected void |
saveRefreshToken(RefreshToken refreshToken) |
void |
setClient(Client client)
Set a Client
|
void |
setJwtTokenConsumer(JoseJwtConsumer jwtTokenConsumer) |
void |
setStoreJwtTokenKeyOnly(boolean storeJwtTokenKeyOnly) |
authenticateUnregisteredClient, checkRequestedScopes, convertScopeToPermissions, convertSingleScopeToPermission, createAccessToken, createClientCredentialsClient, createJwtAccessToken, createNewAccessToken, createNewRefreshToken, doCreateAccessToken, doCreateNewRefreshToken, doRefreshAccessToken, getClient, getCurrentClientSecret, getCurrentRequestedGrantType, getCurrentTokenRequestParams, getDefaultScopes, getInvisibleToClientScopes, getJwtAccessTokenClaimMap, getJwtAccessTokenProducer, getMessageContext, getPermissionMap, getPreauthorizedToken, getRequiredScopes, handleLinkedRefreshToken, init, isClientMatched, isRecycleRefreshTokens, isRefreshTokenSupported, isSupportPreauthorizedTokens, isTokenMatched, isUseJwtFormatForAccessTokens, linkAccessTokenToRefreshToken, linkRefreshTokenToAccessToken, processJwtAccessToken, refreshAccessToken, removeClient, removeClientTokens, revokeAccessToken, revokeAccessTokens, revokeRefreshToken, revokeToken, setAccessTokenLifetime, setAuthenticationStrategy, setClients, setDefaultScopes, setInvisibleToClientScopes, setJwtAccessTokenClaimMap, setJwtAccessTokenProducer, setMessageContext, setPermissionMap, setRecycleRefreshTokens, setRefreshTokenLifetime, setRequiredScopes, setSupportedScopes, setSupportPreauthorizedTokens, setUseJwtFormatForAccessTokens, unlinkRefreshAccessToken, updateExistingRefreshToken, updateRefreshToken
public static final String CLIENT_CACHE_KEY
public static final String ACCESS_TOKEN_CACHE_KEY
public static final String REFRESH_TOKEN_CACHE_KEY
public static final String DEFAULT_CONFIG_URL
protected net.sf.ehcache.CacheManager cacheManager
public DefaultEHCacheOAuthDataProvider()
public DefaultEHCacheOAuthDataProvider(String configFileURL, Bus bus)
public Client doGetClient(String clientId) throws OAuthServiceException
doGetClient
in class AbstractOAuthDataProvider
OAuthServiceException
public void setClient(Client client)
ClientRegistrationProvider
client
- the clientprotected void doRemoveClient(Client c)
doRemoveClient
in class AbstractOAuthDataProvider
public List<Client> getClients(UserSubject resourceOwner)
ClientRegistrationProvider
resourceOwner
- the resource owner, can be nullpublic List<ServerAccessToken> getAccessTokens(Client c, UserSubject sub)
OAuthDataProvider
c
- the clientsub
- the user subject, can be nullpublic List<RefreshToken> getRefreshTokens(Client c, UserSubject sub)
OAuthDataProvider
c
- the clientsub
- the user subject, can be nullpublic ServerAccessToken getAccessToken(String accessToken) throws OAuthServiceException
OAuthDataProvider
accessToken
- the token keyOAuthServiceException
protected void doRevokeAccessToken(ServerAccessToken at)
doRevokeAccessToken
in class AbstractOAuthDataProvider
protected RefreshToken getRefreshToken(String refreshTokenKey)
getRefreshToken
in class AbstractOAuthDataProvider
protected void doRevokeRefreshToken(RefreshToken rt)
doRevokeRefreshToken
in class AbstractOAuthDataProvider
protected void saveAccessToken(ServerAccessToken serverToken)
saveAccessToken
in class AbstractOAuthDataProvider
protected void saveRefreshToken(RefreshToken refreshToken)
saveRefreshToken
in class AbstractOAuthDataProvider
protected static <T> T getCacheValue(net.sf.ehcache.Ehcache cache, String key, Class<T> cls)
protected static void putCacheValue(net.sf.ehcache.Ehcache cache, String key, Object value, long ttl)
protected static net.sf.ehcache.Ehcache createCache(net.sf.ehcache.CacheManager cacheManager, String cacheKey)
public void close()
close
in class AbstractOAuthDataProvider
public boolean isStoreJwtTokenKeyOnly()
public void setStoreJwtTokenKeyOnly(boolean storeJwtTokenKeyOnly)
public void setJwtTokenConsumer(JoseJwtConsumer jwtTokenConsumer)
Apache CXF