Class AuthorizationController
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.plugin.authn.oidc.rp.impl.AuthorizationController
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent
@ThreadSafe
@Controller
@RequestMapping("%{idp.authn.oidc.rp.externalAuthnPath:/Authn/OIDC/RP}")
public class AuthorizationController
extends AbstractInitializableComponent
Servlet compatible with the
ExternalAuthentication interface that begins, by HTTP redirect, an
OpenID Connect authentication request to an OpenID Connect Provider (an OAuth 2.0 Authorization Server
that supports OpenID Connect).
The servlet also consumes the HTTP authentication response from the OpenID Connect provider, decodes it, adds it the the input message context, and resumes IdP processing.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe final part of the IdP URL path which is called to begin authorization.static final StringThe final part of the IdP URL path which is called to end authorization via the callback.static final StringThe name of the Http parameter that stores the authorisation code.private final org.slf4j.LoggerClass logger.Lookup strategy to locate the SAML context.Lookup strategy to locate the nested ProfileRequestContext.static final StringThe name of the Http parameter that stores the state value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidauthorizationCallback(HttpServletRequest httpRequest, HttpServletResponse httpResponse) Callback endpoint to accept the authorization response.voidauthorizationRequest(HttpServletRequest httpRequest, HttpServletResponse httpResponse) Begin an authorization request to the configured upstream OP.voidSet the lookup strategy used to locate theOIDCAuthnContext.voidsetProfileRequestContextLookupStrategy(Function<ProfileRequestContext, ProfileRequestContext> strategy) Set the lookup strategy used to locate the nestedProfileRequestContext.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
AUTHORIZE_PATH_SEGMENT
The final part of the IdP URL path which is called to begin authorization.- See Also:
-
CALLBACK_PATH_SEGMENT
The final part of the IdP URL path which is called to end authorization via the callback.- See Also:
-
CODE_PARAMETER
The name of the Http parameter that stores the authorisation code.- See Also:
-
STATE_PARAMETER
The name of the Http parameter that stores the state value.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
profileRequestContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,ProfileRequestContext> profileRequestContextLookupStrategyLookup strategy to locate the nested ProfileRequestContext. -
oidcContextLookupStrategy
Lookup strategy to locate the SAML context.
-
-
Constructor Details
-
AuthorizationController
public AuthorizationController()Constructor.
-
-
Method Details
-
setProfileRequestContextLookupStrategy
public void setProfileRequestContextLookupStrategy(@Nonnull Function<ProfileRequestContext, ProfileRequestContext> strategy) Set the lookup strategy used to locate the nestedProfileRequestContext.- Parameters:
strategy- lookup strategy
-
setOidcAuthnContextLookupStrategy
public void setOidcAuthnContextLookupStrategy(@Nonnull Function<ProfileRequestContext, OIDCAuthnContext> strategy) Set the lookup strategy used to locate theOIDCAuthnContext.- Parameters:
strategy- lookup strategy
-
authorizationRequest
@GetMapping("/authz") public void authorizationRequest(@Nonnull HttpServletRequest httpRequest, @Nonnull HttpServletResponse httpResponse) throws ServletException, IOException, ExternalAuthenticationException Begin an authorization request to the configured upstream OP.- Parameters:
httpRequest- the servlet request.httpResponse- the servlet response.- Throws:
ServletException- throw if there is an error constructing an authz request.IOException- throw if there is an error constructing an authz request.ExternalAuthenticationException- throw if there is a general error constructing an authz request.
-
authorizationCallback
@RequestMapping("/callback") public void authorizationCallback(@Nonnull HttpServletRequest httpRequest, @Nonnull HttpServletResponse httpResponse) throws ExternalAuthenticationException, IOException Callback endpoint to accept the authorization response.- Parameters:
httpRequest- the servlet request.httpResponse- the servlet response.- Throws:
ExternalAuthenticationException- throw if there is an error accepting the authz response.IOException- throw if there is an error accepting the authz response.
-