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 Constructor Description JPACodeDataProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerAuthorizationCodeGrantcreateCodeGrant(AuthorizationCodeRegistration reg)Creates a temporarily code grant which will capture the information about theClientrequesting the access to the resource owner's resourcesprotected ServerAuthorizationCodeGrantdoCreateCodeGrant(AuthorizationCodeRegistration reg)protected voiddoRemoveClient(Client c)List<ServerAuthorizationCodeGrant>getCodeGrants(Client c, UserSubject subject)Return the list of code grants associated with a given clientprotected javax.persistence.TypedQuery<ServerAuthorizationCodeGrant>getCodesQuery(Client c, UserSubject resourceOwnerSubject, javax.persistence.EntityManager em)protected voidremoveClientCodeGrants(Client c)protected voidremoveClientCodeGrants(Client c, javax.persistence.EntityManager em)ServerAuthorizationCodeGrantremoveCodeGrant(String code)Returns the previously registeredServerAuthorizationCodeGrantprotected voidsaveCodeGrant(ServerAuthorizationCodeGrant grant)voidsetCodeLifetime(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, setEntityManagerFactory
-
Methods 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, 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
-
-
-
-
Method Detail
-
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
-
doCreateCodeGrant
protected ServerAuthorizationCodeGrant doCreateCodeGrant(AuthorizationCodeRegistration reg) throws OAuthServiceException
- Throws:
OAuthServiceException
-
saveCodeGrant
protected void saveCodeGrant(ServerAuthorizationCodeGrant grant)
-
doRemoveClient
protected void doRemoveClient(Client c)
- Overrides:
doRemoveClientin classJPAOAuthDataProvider
-
removeClientCodeGrants
protected void removeClientCodeGrants(Client c)
-
removeClientCodeGrants
protected void removeClientCodeGrants(Client c, javax.persistence.EntityManager em)
-
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
-
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:
ServerAuthorizationCodeGrant
-
setCodeLifetime
public void setCodeLifetime(long codeLifetime)
-
getCodesQuery
protected javax.persistence.TypedQuery<ServerAuthorizationCodeGrant> getCodesQuery(Client c, UserSubject resourceOwnerSubject, javax.persistence.EntityManager em)
-
-