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
Fields Modifier and Type Field Description static StringCODE_GRANT_CACHE_KEY-
Fields 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
Constructors Modifier Constructor Description protectedJCacheCodeDataProvider()protectedJCacheCodeDataProvider(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ServerAuthorizationCodeGrantcreateCodeGrant(AuthorizationCodeRegistration reg)Creates a temporarily code grant which will capture the information about theClientrequesting the access to the resource owner's resourcesprotected voiddoRemoveClient(Client c)protected ServerAuthorizationCodeGrantgetCodeGrant(String code)List<ServerAuthorizationCodeGrant>getCodeGrants(Client c, UserSubject sub)Return the list of code grants associated with a given clientprotected static booleanisExpired(ServerAuthorizationCodeGrant grant)ServerAuthorizationCodeGrantremoveCodeGrant(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, setJwtTokenConsumer
-
Methods 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, updateRefreshToken
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cxf.rs.security.oauth2.provider.OAuthDataProvider
convertScopeToPermissions, createAccessToken, getAccessToken, getAccessTokens, getClient, getPreauthorizedToken, getRefreshTokens, refreshAccessToken, revokeToken
-
-
-
-
Field Detail
-
CODE_GRANT_CACHE_KEY
public static final String CODE_GRANT_CACHE_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
doRemoveClient
protected void doRemoveClient(Client c)
- 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:
AuthorizationCodeRegistration,ServerAuthorizationCodeGrant
-
getCodeGrants
public List<ServerAuthorizationCodeGrant> getCodeGrants(Client c, UserSubject sub)
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:
ServerAuthorizationCodeGrant
-
removeCodeGrant
public ServerAuthorizationCodeGrant removeCodeGrant(String code) throws OAuthServiceException
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:
ServerAuthorizationCodeGrant
-
setCodeLifetime
public void setCodeLifetime(long codeLifetime)
-
getCodeGrant
protected ServerAuthorizationCodeGrant getCodeGrant(String code) throws OAuthServiceException
- Throws:
OAuthServiceException
-
isExpired
protected static boolean isExpired(ServerAuthorizationCodeGrant grant)
-
close
public void close()
- Overrides:
closein classJCacheOAuthDataProvider
-
-