Class JPACodeDataProvider
java.lang.Object
org.apache.cxf.rs.security.oauth2.provider.AbstractOAuthDataProvider
org.apache.cxf.rs.security.oauth2.provider.JPAOAuthDataProvider
org.apache.cxf.rs.security.oauth2.grants.code.JPACodeDataProvider
- All Implemented Interfaces:
AuthorizationCodeDataProvider,ClientRegistrationProvider,OAuthDataProvider
- Direct Known Subclasses:
JPACMTCodeDataProvider
public class JPACodeDataProvider
extends JPAOAuthDataProvider
implements AuthorizationCodeDataProvider
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.cxf.rs.security.oauth2.provider.JPAOAuthDataProvider
JPAOAuthDataProvider.EntityManagerOperation<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a temporarily code grant which will capture the information about theClientrequesting the access to the resource owner's resourcesprotected ServerAuthorizationCodeGrantprotected voidgetCodeGrants(Client c, UserSubject subject) Return the list of code grants associated with a given clientprotected jakarta.persistence.TypedQuery<ServerAuthorizationCodeGrant>getCodesQuery(Client c, UserSubject resourceOwnerSubject, jakarta.persistence.EntityManager em) protected voidprotected voidremoveClientCodeGrants(Client c, jakarta.persistence.EntityManager em) removeCodeGrant(String code) Returns the previously registeredServerAuthorizationCodeGrantprotected voidvoidsetCodeLifetime(long codeLifetime) Methods inherited from class org.apache.cxf.rs.security.oauth2.provider.JPAOAuthDataProvider
beginIfNeeded, closeIfNeeded, commitIfNeeded, doCreateAccessToken, doGetClient, doRevokeAccessToken, doRevokeRefreshToken, execute, executeInTransaction, flushIfNeeded, getAccessToken, getAccessTokens, getClients, getClientsQuery, getEntityManager, getRefreshToken, getRefreshTokens, getRefreshTokensQuery, getTokensQuery, linkRefreshTokenToAccessToken, persistEntity, removeEntity, saveAccessToken, saveRefreshToken, setClient, setEntityManagerFactoryMethods inherited from class org.apache.cxf.rs.security.oauth2.provider.AbstractOAuthDataProvider
authenticateUnregisteredClient, checkRequestedScopes, close, convertScopeToPermissions, convertSingleScopeToPermission, convertToJWTAccessToken, 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, 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
-
Constructor Details
-
JPACodeDataProvider
public JPACodeDataProvider()
-
-
Method Details
-
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:
-
doCreateCodeGrant
protected ServerAuthorizationCodeGrant doCreateCodeGrant(AuthorizationCodeRegistration reg) throws OAuthServiceException - Throws:
OAuthServiceException
-
saveCodeGrant
-
doRemoveClient
- Overrides:
doRemoveClientin classJPAOAuthDataProvider
-
removeClientCodeGrants
-
removeClientCodeGrants
-
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:
-
getCodeGrants
public List<ServerAuthorizationCodeGrant> getCodeGrants(Client c, UserSubject subject) throws OAuthServiceException Description copied from interface:AuthorizationCodeDataProviderReturn the list of code grants associated with a given client- Specified by:
getCodeGrantsin interfaceAuthorizationCodeDataProvider- Parameters:
c- the clientsubject- the user subject, can be null- Returns:
- the list of grants
- Throws:
OAuthServiceException- See Also:
-
setCodeLifetime
public void setCodeLifetime(long codeLifetime) -
getCodesQuery
protected jakarta.persistence.TypedQuery<ServerAuthorizationCodeGrant> getCodesQuery(Client c, UserSubject resourceOwnerSubject, jakarta.persistence.EntityManager em)
-