Class AuthorizationCodeGrantService
- java.lang.Object
-
- org.apache.cxf.rs.security.oauth2.services.AbstractOAuthService
-
- org.apache.cxf.rs.security.oauth2.services.RedirectionBasedGrantService
-
- org.apache.cxf.rs.security.oauth2.services.AuthorizationCodeGrantService
-
- Direct Known Subclasses:
OidcAuthorizationCodeService
@Path("/authorize") public class AuthorizationCodeGrantService extends RedirectionBasedGrantServiceThis resource handles the End User authorizing or denying the Client to access its resources. If End User approves the access this resource will redirect End User back to the Client, supplying the authorization code.
-
-
Field Summary
-
Fields inherited from class org.apache.cxf.rs.security.oauth2.services.AbstractOAuthService
LOG
-
-
Constructor Summary
Constructors Constructor Description AuthorizationCodeGrantService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanRedirectUriBeEmpty(Client c)protected booleancanSupportPublicClient(Client c)protected AuthorizationCodeRegistrationcreateCodeRegistration(OAuthRedirectionState state, Client client, List<String> requestedScope, List<String> approvedScope, UserSubject userSubject, ServerAccessToken preauthorizedToken)protected javax.ws.rs.core.ResponsecreateErrorResponse(String state, String redirectUri, String error)protected javax.ws.rs.core.ResponsecreateGrant(OAuthRedirectionState state, Client client, List<String> requestedScope, List<String> approvedScope, UserSubject userSubject, ServerAccessToken preauthorizedToken)protected javax.ws.rs.core.ResponsedeliverOOBResponse(OOBAuthorizationResponse response)ServerAuthorizationCodeGrantgetGrantRepresentation(OAuthRedirectionState state, Client client, List<String> requestedScope, List<String> approvedScope, UserSubject userSubject, ServerAccessToken preauthorizedToken)protected javax.ws.rs.core.UriBuildergetRedirectUriBuilder(String state, String redirectUri)protected StringprocessCodeGrant(Client client, String code, UserSubject endUser)protected OAuthRedirectionStaterecreateRedirectionStateFromParams(javax.ws.rs.core.MultivaluedMap<String,String> params)voidsetCanSupportEmptyRedirectForPrivateClients(boolean canSupportEmptyRedirectForPrivateClients)voidsetCanSupportPublicClients(boolean support)voidsetCodeResponseFilter(AuthorizationCodeResponseFilter filter)-
Methods inherited from class org.apache.cxf.rs.security.oauth2.services.RedirectionBasedGrantService
authorize, authorizeDecision, authorizeDecisionForm, authorizePost, canAccessTokenBeReturned, canAuthorizationBeSkipped, completeAuthorization, createAuthorizationData, createErrorResponse, createHtmlResponse, createUserSubject, getAndValidateSecurityContext, getApprovedScope, getClient, getSupportedGrantType, getSupportedResponseTypes, isFormResponse, isRevokePreauthorizedTokenOnApproval, noConsentForRequestedScopes, personalizeData, recreateRedirectionStateFromSession, setAuthorizationFilter, setHidePreauthorizedScopesInForm, setMatchRedirectUriWithApplicationUri, setMaxDefaultSessionInterval, setPartialMatchScopeValidation, setResourceOwnerNameProvider, setRevokePreauthorizedTokenOnApproval, setScopesRequiringNoConsent, setSessionAuthenticityTokenProvider, setSubjectCreator, setSupportSinglePageApplications, setUseAllClientScopes, setUseRegisteredRedirectUriIfPossible, startAuthorization, startAuthorization, validateRedirectUri
-
Methods inherited from class org.apache.cxf.rs.security.oauth2.services.AbstractOAuthService
checkTransportSecurity, getDataProvider, getMessageContext, getQueryParameters, getValidClient, getValidClient, injectContextIntoOAuthProviders, isWriteOptionalParameters, reportInvalidRequestError, reportInvalidRequestError, reportInvalidRequestError, reportInvalidRequestError, setBlockUnsecureRequests, setDataProvider, setMessageContext, setWriteOptionalParameters
-
-
-
-
Method Detail
-
recreateRedirectionStateFromParams
protected OAuthRedirectionState recreateRedirectionStateFromParams(javax.ws.rs.core.MultivaluedMap<String,String> params)
- Overrides:
recreateRedirectionStateFromParamsin classRedirectionBasedGrantService
-
createGrant
protected javax.ws.rs.core.Response createGrant(OAuthRedirectionState state, Client client, List<String> requestedScope, List<String> approvedScope, UserSubject userSubject, ServerAccessToken preauthorizedToken)
- Specified by:
createGrantin classRedirectionBasedGrantService
-
getGrantRepresentation
public ServerAuthorizationCodeGrant getGrantRepresentation(OAuthRedirectionState state, Client client, List<String> requestedScope, List<String> approvedScope, UserSubject userSubject, ServerAccessToken preauthorizedToken)
-
createCodeRegistration
protected AuthorizationCodeRegistration createCodeRegistration(OAuthRedirectionState state, Client client, List<String> requestedScope, List<String> approvedScope, UserSubject userSubject, ServerAccessToken preauthorizedToken)
-
processCodeGrant
protected String processCodeGrant(Client client, String code, UserSubject endUser)
-
deliverOOBResponse
protected javax.ws.rs.core.Response deliverOOBResponse(OOBAuthorizationResponse response)
-
createErrorResponse
protected javax.ws.rs.core.Response createErrorResponse(String state, String redirectUri, String error)
- Specified by:
createErrorResponsein classRedirectionBasedGrantService
-
getRedirectUriBuilder
protected javax.ws.rs.core.UriBuilder getRedirectUriBuilder(String state, String redirectUri)
-
canSupportPublicClient
protected boolean canSupportPublicClient(Client c)
- Specified by:
canSupportPublicClientin classRedirectionBasedGrantService
-
canRedirectUriBeEmpty
protected boolean canRedirectUriBeEmpty(Client c)
- Specified by:
canRedirectUriBeEmptyin classRedirectionBasedGrantService
-
setCanSupportPublicClients
public void setCanSupportPublicClients(boolean support)
-
setCodeResponseFilter
public void setCodeResponseFilter(AuthorizationCodeResponseFilter filter)
-
setCanSupportEmptyRedirectForPrivateClients
public void setCanSupportEmptyRedirectForPrivateClients(boolean canSupportEmptyRedirectForPrivateClients)
-
-