Class AuthorizationController
- java.lang.Object
-
- net.shibboleth.utilities.java.support.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 theExternalAuthenticationinterface 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
Fields Modifier and Type Field Description static StringAUTHORIZE_PATH_SEGMENTThe final part of the IdP URL path which is called to begin authorization.static StringCALLBACK_PATH_SEGMENTThe final part of the IdP URL path which is called to end authorization via the callback.static StringCODE_PARAMETERThe name of the Http parameter that stores the authorisation code.private org.slf4j.LoggerlogClass logger.private Function<ProfileRequestContext,OAuth2ClientContext>oauth2ClientContextLookupStrategyThe strategy used to lookup or create theOAuth2ClientContextfor storing the client_id.private Function<ProfileRequestContext,OIDCAuthnContext>oidcContextLookupStrategyLookup strategy to locate the SAML context.private Function<ProfileRequestContext,ProfileRequestContext>profileRequestContextLookupStrategyLookup strategy to locate the nested ProfileRequestContext.static StringSTATE_PARAMETERThe name of the Http parameter that stores the state value.
-
Constructor Summary
Constructors Constructor Description AuthorizationController()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidauthorizationCallback(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse)Callback endpoint to accept the authorization response.voidauthorizationRequest(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse)Begin an authorization request to the configured upstream OP.voidsetOAuth2ClientContextLookupStrategy(Function<ProfileRequestContext,OAuth2ClientContext> strgy)Set the strategy to lookup theOAuth2ClientContextfrom theProfileRequestContext.voidsetOidcAuthnContextLookupStrategy(Function<ProfileRequestContext,OIDCAuthnContext> strategy)Set 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.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
AUTHORIZE_PATH_SEGMENT
@Nonnull @NotEmpty public static final String AUTHORIZE_PATH_SEGMENT
The final part of the IdP URL path which is called to begin authorization.- See Also:
- Constant Field Values
-
CALLBACK_PATH_SEGMENT
@Nonnull @NotEmpty public static final String CALLBACK_PATH_SEGMENT
The final part of the IdP URL path which is called to end authorization via the callback.- See Also:
- Constant Field Values
-
CODE_PARAMETER
@Nonnull @NotEmpty public static final String CODE_PARAMETER
The name of the Http parameter that stores the authorisation code.- See Also:
- Constant Field Values
-
STATE_PARAMETER
@Nonnull @NotEmpty public static final String STATE_PARAMETER
The name of the Http parameter that stores the state value.- See Also:
- Constant Field Values
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
profileRequestContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,ProfileRequestContext> profileRequestContextLookupStrategy
Lookup strategy to locate the nested ProfileRequestContext.
-
oidcContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,OIDCAuthnContext> oidcContextLookupStrategy
Lookup strategy to locate the SAML context.
-
oauth2ClientContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,OAuth2ClientContext> oauth2ClientContextLookupStrategy
The strategy used to lookup or create theOAuth2ClientContextfor storing the client_id.
-
-
Method Detail
-
setOAuth2ClientContextLookupStrategy
public void setOAuth2ClientContextLookupStrategy(@Nonnull Function<ProfileRequestContext,OAuth2ClientContext> strgy)Set the strategy to lookup theOAuth2ClientContextfrom theProfileRequestContext.- Parameters:
strgy- the strategy.
-
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 javax.servlet.http.HttpServletRequest httpRequest, @Nonnull javax.servlet.http.HttpServletResponse httpResponse) throws javax.servlet.ServletException, IOException, ExternalAuthenticationException
Begin an authorization request to the configured upstream OP.- Parameters:
httpRequest- the servlet request.httpResponse- the servlet response.- Throws:
javax.servlet.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 javax.servlet.http.HttpServletRequest httpRequest, @Nonnull javax.servlet.http.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.
-
-