public class JCacheOAuthDataProvider extends AbstractOAuthDataProvider
Modifier and Type | Field and Description |
---|---|
static String |
ACCESS_TOKEN_CACHE_KEY |
protected javax.cache.CacheManager |
cacheManager |
static String |
CLIENT_CACHE_KEY |
static String |
DEFAULT_CONFIG_URL |
static String |
REFRESH_TOKEN_CACHE_KEY |
Constructor and Description |
---|
JCacheOAuthDataProvider() |
JCacheOAuthDataProvider(boolean storeJwtTokenKeyOnly) |
JCacheOAuthDataProvider(String configFileURL,
Bus bus) |
JCacheOAuthDataProvider(String configFileURL,
Bus bus,
boolean storeJwtTokenKeyOnly) |
JCacheOAuthDataProvider(String configFileURL,
Bus bus,
String clientCacheKey,
String accessTokenCacheKey,
String refreshTokenCacheKey) |
JCacheOAuthDataProvider(String configFileURL,
Bus bus,
String clientCacheKey,
String accessTokenCacheKey,
String refreshTokenCacheKey,
boolean storeJwtTokenKeyOnly) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected static <K,V> javax.cache.Cache<K,V> |
createCache(javax.cache.CacheManager cacheManager,
String cacheKey,
Class<K> keyType,
Class<V> valueType) |
protected static javax.cache.CacheManager |
createCacheManager(String configFile,
Bus bus) |
Client |
doGetClient(String clientId) |
protected void |
doRemoveClient(Client c) |
protected void |
doRevokeAccessToken(ServerAccessToken at) |
protected void |
doRevokeRefreshToken(RefreshToken rt) |
ServerAccessToken |
getAccessToken(String accessTokenKey)
Get access token
|
List<ServerAccessToken> |
getAccessTokens(Client c,
UserSubject sub)
Return all access tokens associated with a given client
|
List<Client> |
getClients(UserSubject resourceOwner)
Get a list of clients registered by a resource owner.
|
protected ServerAccessToken |
getJwtAccessToken(String key) |
protected List<ServerAccessToken> |
getJwtAccessTokens(Client client,
UserSubject sub) |
protected RefreshToken |
getRefreshToken(String refreshTokenKey) |
List<RefreshToken> |
getRefreshTokens(Client c,
UserSubject sub)
Return all refresh tokens associated with a given client
|
protected static <V extends ServerAccessToken> |
getToken(javax.cache.Cache<String,V> cache,
String key) |
protected static <K,V extends ServerAccessToken> |
getTokens(javax.cache.Cache<K,V> cache,
Client client,
UserSubject sub) |
protected static boolean |
isExpired(ServerAccessToken token) |
boolean |
isStoreJwtTokenKeyOnly() |
protected void |
linkRefreshTokenToAccessToken(RefreshToken rt,
ServerAccessToken at) |
protected void |
saveAccessToken(ServerAccessToken serverToken) |
protected void |
saveRefreshToken(RefreshToken refreshToken) |
void |
setClient(Client client)
Set a Client
|
void |
setJwtTokenConsumer(JoseJwtConsumer jwtTokenConsumer) |
authenticateUnregisteredClient, checkRequestedScopes, convertScopeToPermissions, convertSingleScopeToPermission, createAccessToken, createClientCredentialsClient, createJwtAccessToken, createNewAccessToken, createNewRefreshToken, doCreateAccessToken, doCreateNewRefreshToken, doRefreshAccessToken, getClient, getCurrentClientSecret, getCurrentRequestedGrantType, getCurrentTokenRequestParams, getDefaultScopes, getInvisibleToClientScopes, getIssuer, getJwtAccessTokenClaimMap, getJwtAccessTokenProducer, getMessageContext, getPermissionMap, getPreauthorizedToken, getRequiredScopes, handleLinkedRefreshToken, init, isClientMatched, isPersistJwtEncoding, isRecycleRefreshTokens, isRefreshTokenSupported, isSupportPreauthorizedTokens, isTokenMatched, isUseJwtFormatForAccessTokens, linkAccessTokenToRefreshToken, processJwtAccessToken, refreshAccessToken, removeClient, removeClientTokens, revokeAccessToken, revokeAccessTokens, revokeRefreshToken, revokeToken, setAccessTokenLifetime, setAuthenticationStrategy, setClients, setDefaultScopes, setInvisibleToClientScopes, setIssuer, setJwtAccessTokenClaimMap, setJwtAccessTokenProducer, setMessageContext, setPermissionMap, setPersistJwtEncoding, 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 final javax.cache.CacheManager cacheManager
public JCacheOAuthDataProvider()
public JCacheOAuthDataProvider(boolean storeJwtTokenKeyOnly)
public JCacheOAuthDataProvider(String configFileURL, Bus bus, boolean storeJwtTokenKeyOnly)
public JCacheOAuthDataProvider(String configFileURL, Bus bus, String clientCacheKey, String accessTokenCacheKey, String refreshTokenCacheKey)
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 accessTokenKey) throws OAuthServiceException
OAuthDataProvider
accessTokenKey
- 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 void linkRefreshTokenToAccessToken(RefreshToken rt, ServerAccessToken at)
linkRefreshTokenToAccessToken
in class AbstractOAuthDataProvider
public void close()
close
in class AbstractOAuthDataProvider
protected static <V extends ServerAccessToken> V getToken(javax.cache.Cache<String,V> cache, String key)
protected ServerAccessToken getJwtAccessToken(String key)
protected static <K,V extends ServerAccessToken> List<V> getTokens(javax.cache.Cache<K,V> cache, Client client, UserSubject sub)
protected List<ServerAccessToken> getJwtAccessTokens(Client client, UserSubject sub)
protected static boolean isExpired(ServerAccessToken token)
protected static javax.cache.CacheManager createCacheManager(String configFile, Bus bus)
protected static <K,V> javax.cache.Cache<K,V> createCache(javax.cache.CacheManager cacheManager, String cacheKey, Class<K> keyType, Class<V> valueType)
public boolean isStoreJwtTokenKeyOnly()
public void setJwtTokenConsumer(JoseJwtConsumer jwtTokenConsumer)
Apache CXF