Class DefaultEncryptingCodeDataProvider
- java.lang.Object
-
- org.apache.cxf.rs.security.oauth2.provider.AbstractOAuthDataProvider
-
- org.apache.cxf.rs.security.oauth2.provider.DefaultEncryptingOAuthDataProvider
-
- org.apache.cxf.rs.security.oauth2.grants.code.DefaultEncryptingCodeDataProvider
-
- All Implemented Interfaces:
AuthorizationCodeDataProvider,ClientRegistrationProvider,OAuthDataProvider
public class DefaultEncryptingCodeDataProvider extends DefaultEncryptingOAuthDataProvider implements AuthorizationCodeDataProvider
-
-
Field Summary
-
Fields inherited from class org.apache.cxf.rs.security.oauth2.provider.DefaultEncryptingOAuthDataProvider
key
-
-
Constructor Summary
Constructors Constructor Description DefaultEncryptingCodeDataProvider(String algo, int keySize)DefaultEncryptingCodeDataProvider(SecretKey key)DefaultEncryptingCodeDataProvider(KeyProperties props)
-
Method Summary
-
Methods inherited from class org.apache.cxf.rs.security.oauth2.provider.DefaultEncryptingOAuthDataProvider
doGetClient, doRemoveClient, doRevokeAccessToken, doRevokeRefreshToken, getAccessToken, getAccessTokens, getClients, getRefreshToken, getRefreshTokens, saveAccessToken, saveRefreshToken, setClient
-
Methods inherited from class org.apache.cxf.rs.security.oauth2.provider.AbstractOAuthDataProvider
authenticateUnregisteredClient, checkRequestedScopes, close, 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, linkRefreshTokenToAccessToken, processJwtAccessToken, refreshAccessToken, 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
-
-
-
-
Constructor Detail
-
DefaultEncryptingCodeDataProvider
public DefaultEncryptingCodeDataProvider(String algo, int keySize)
-
DefaultEncryptingCodeDataProvider
public DefaultEncryptingCodeDataProvider(KeyProperties props)
-
DefaultEncryptingCodeDataProvider
public DefaultEncryptingCodeDataProvider(SecretKey key)
-
-
Method Detail
-
removeClient
public Client removeClient(String clientId)
Description copied from interface:ClientRegistrationProviderRemove a Client with the given id- Specified by:
removeClientin interfaceClientRegistrationProvider- Overrides:
removeClientin classAbstractOAuthDataProvider- Parameters:
clientId- the client id- Returns:
- Client
-
removeClientCodeGrants
protected void removeClientCodeGrants(Client c)
-
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
-
getCodeGrant
public ServerAuthorizationCodeGrant getCodeGrant(String code) throws OAuthServiceException
- Throws:
OAuthServiceException
-
doCreateCodeGrant
protected ServerAuthorizationCodeGrant doCreateCodeGrant(AuthorizationCodeRegistration reg) throws OAuthServiceException
- Throws:
OAuthServiceException
-
getApprovedScopes
protected List<String> getApprovedScopes(AuthorizationCodeRegistration reg)
-
getCode
protected String getCode(AuthorizationCodeRegistration reg)
-
getGrantLifetime
public long getGrantLifetime()
-
setGrantLifetime
public void setGrantLifetime(long lifetime)
-
getIssuedAt
protected long getIssuedAt()
-
saveAuthorizationGrant
protected void saveAuthorizationGrant(ServerAuthorizationCodeGrant grant)
-
-