Class JCacheCodeDataProvider
java.lang.Object
org.apache.cxf.rs.security.oauth2.provider.AbstractOAuthDataProvider
org.apache.cxf.rs.security.oauth2.provider.JCacheOAuthDataProvider
org.apache.cxf.rs.security.oauth2.grants.code.JCacheCodeDataProvider
- All Implemented Interfaces:
AuthorizationCodeDataProvider,ClientRegistrationProvider,OAuthDataProvider
public class JCacheCodeDataProvider
extends JCacheOAuthDataProvider
implements AuthorizationCodeDataProvider
-
Field Summary
FieldsFields inherited from class org.apache.cxf.rs.security.oauth2.provider.JCacheOAuthDataProvider
ACCESS_TOKEN_CACHE_KEY, cacheManager, CLIENT_CACHE_KEY, DEFAULT_CONFIG_URL, REFRESH_TOKEN_CACHE_KEY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedJCacheCodeDataProvider(String configFileURL, Bus bus) protectedJCacheCodeDataProvider(String configFileURL, Bus bus, String clientCacheKey, String codeCacheKey, String accessTokenKey, String refreshTokenKey) protectedJCacheCodeDataProvider(String configFileURL, Bus bus, String clientCacheKey, String codeCacheKey, String accessTokenKey, String refreshTokenKey, boolean storeJwtTokenKeyOnly) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Creates a temporarily code grant which will capture the information about theClientrequesting the access to the resource owner's resourcesprotected voidprotected ServerAuthorizationCodeGrantgetCodeGrant(String code) getCodeGrants(Client c, UserSubject sub) Return the list of code grants associated with a given clientprotected static booleanremoveCodeGrant(String code) Returns the previously registeredServerAuthorizationCodeGrantvoidsetCodeLifetime(long codeLifetime) Methods inherited from class org.apache.cxf.rs.security.oauth2.provider.JCacheOAuthDataProvider
createCache, createCacheManager, doGetClient, doRevokeAccessToken, doRevokeRefreshToken, getAccessToken, getAccessTokens, getClients, getJwtAccessToken, getJwtAccessTokens, getRefreshToken, getRefreshTokens, getToken, getTokens, isExpired, isStoreJwtTokenKeyOnly, linkRefreshTokenToAccessToken, saveAccessToken, saveRefreshToken, setClient, setJwtTokenConsumerMethods inherited from class org.apache.cxf.rs.security.oauth2.provider.AbstractOAuthDataProvider
authenticateUnregisteredClient, checkRequestedScopes, convertScopeToPermissions, convertSingleScopeToPermission, convertToJWTAccessToken, createAccessToken, createClientCredentialsClient, createJwtAccessToken, createNewAccessToken, createNewRefreshToken, doCreateAccessToken, 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, updateRefreshTokenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cxf.rs.security.oauth2.provider.OAuthDataProvider
convertScopeToPermissions, createAccessToken, getAccessToken, getAccessTokens, getClient, getPreauthorizedToken, getRefreshTokens, refreshAccessToken, revokeToken
-
Field Details
-
CODE_GRANT_CACHE_KEY
- See Also:
-
-
Constructor Details
-
JCacheCodeDataProvider
protected JCacheCodeDataProvider() -
JCacheCodeDataProvider
-
JCacheCodeDataProvider
-
JCacheCodeDataProvider
-
-
Method Details
-
doRemoveClient
- Overrides:
doRemoveClientin classJCacheOAuthDataProvider
-
createCodeGrant
public ServerAuthorizationCodeGrant createCodeGrant(AuthorizationCodeRegistration reg) throws OAuthServiceException Description copied from interface:AuthorizationCodeDataProviderCreates a temporarily code grant which will capture the information about theClientrequesting the access to the resource owner's resources- Specified by:
createCodeGrantin interfaceAuthorizationCodeDataProvider- Parameters:
reg- information about the client code grant request- Returns:
- new code grant
- Throws:
OAuthServiceException- See Also:
-
getCodeGrants
Description copied from interface:AuthorizationCodeDataProviderReturn the list of code grants associated with a given client- Specified by:
getCodeGrantsin interfaceAuthorizationCodeDataProvider- Parameters:
c- the clientsub- the user subject, can be null- Returns:
- the list of grants
- See Also:
-
removeCodeGrant
Description copied from interface:AuthorizationCodeDataProviderReturns the previously registeredServerAuthorizationCodeGrant- Specified by:
removeCodeGrantin interfaceAuthorizationCodeDataProvider- Parameters:
code- the code grant- Returns:
- the grant
- Throws:
OAuthServiceException- if no grant with this code is available- See Also:
-
setCodeLifetime
public void setCodeLifetime(long codeLifetime) -
getCodeGrant
- Throws:
OAuthServiceException
-
isExpired
-
close
public void close()- Overrides:
closein classJCacheOAuthDataProvider
-