Class AbstractOIDCAuthenticationRequestActionMessageHandler
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.handler.AbstractMessageHandler
net.shibboleth.idp.plugin.authn.oidc.rp.messaging.impl.AbstractOIDCAuthenticationRequestActionMessageHandler
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MessageHandler
- Direct Known Subclasses:
AddAuthenticationContextClassReferencesHandler,AddEndpointURIHandler,AddForceAuthenticationHandler,AddLoginHintHandler,AddMaxAgeHandler,AddNonceHandler,AddPassiveAuthenticationHandler,AddRedirectURIHandler,AddRequestedClaimsHandler,AddResponseTypeAndModeHandler,AddScopesHandler
public abstract class AbstractOIDCAuthenticationRequestActionMessageHandler
extends AbstractMessageHandler
An abstract message handler that runs inside an
WebFlowMessageHandlerAdaptor
that provides functions to make available various OIDC contexts.
The MessageContext will either be INBOUND or OUTBOUND depending on the direction defined
by the calling WebFlowMessageHandlerAdaptor action.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate OIDCAuthenticationRequestOIDC authentication request built by the IdP.private NonnullSupplier<HttpServletRequest>Current HTTP request, if available.private final org.slf4j.LoggerClass logger.private static final ParentProfileRequestContextLookup<MessageContext>Lookup function for parent ProfileRequestContext.Applicable profile configuration.private com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadataOpenID Provider metadata .Lookup strategy to locate the OpenID Provider metadata to use.Lookup function for relying party context. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> Function<MessageContext,T> adapt(Function<ProfileRequestContext, T> function) Adapt aProfileRequestContextfunction to aMessageContextfunction via composing with a lookup function.protected Predicate<MessageContext>adapt(Predicate<ProfileRequestContext> predicate) Adapt aProfileRequestContextpredicate into aMessageContextpredicate via composing with a lookup function.protected booleandoPreInvoke(MessageContext messageContext) protected OIDCAuthenticationRequestReturns the authentication request build by this IdP.Get the HTTP servlet request supplier.Get the supplier for HTTP request if available.Returns the profile configuration associated with this request.protected com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadataReturns the OpenID Provider metadata.protected ProfileRequestContextlookupProfileRequestContext(MessageContext messageContext) Lookup the profile request context from the given message context using the functionPRC_LOOKUP.voidsetHttpServletRequestSupplier(NonnullSupplier<HttpServletRequest> requestSupplier) Set the HTTP servlet request supplier.voidSet the lookup strategy to locate the OpenID providers metadata.voidSet the strategy used to locate theRelyingPartyContextassociated with a givenProfileRequestContext.Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doInvoke, doPostInvoke, doPostInvoke, getActivationCondition, getLogPrefix, invoke, isPreInvokeCalled, setActivationConditionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
PRC_LOOKUP
Lookup function for parent ProfileRequestContext. -
log
@Nonnull private final org.slf4j.Logger logClass logger. -
providerMetadataLookupStrategy
@Nonnull private Function<MessageContext,OIDCProviderMetadataContext> providerMetadataLookupStrategyLookup strategy to locate the OpenID Provider metadata to use. -
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategyLookup function for relying party context. -
authnRequest
OIDC authentication request built by the IdP. -
providerMetadata
OpenID Provider metadata . -
profileConfiguration
Applicable profile configuration. -
httpServletRequestSupplier
Current HTTP request, if available.
-
-
Constructor Details
-
AbstractOIDCAuthenticationRequestActionMessageHandler
protected AbstractOIDCAuthenticationRequestActionMessageHandler()Constructor.
-
-
Method Details
-
getHttpServletRequest
Get the HTTP servlet request supplier.- Returns:
- the HTTP servlet request supplier
-
getHttpServletRequestSupplier
Get the supplier for HTTP request if available.- Returns:
- current HTTP request
-
getAuthenticationRequest
Returns the authentication request build by this IdP. Should never benullafter afterdoPreExecutehas been called.- Returns:
- the authentication request.
-
getProfileConfiguration
@NonnullBeforeExec protected OIDCAuthenticationRelyingPartyProfileConfiguration getProfileConfiguration()Returns the profile configuration associated with this request. Should never benullafterdoPreExecutehas been called.- Returns:
- the profile configuration
-
getProviderMetadata
@NonnullBeforeExec protected com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata getProviderMetadata()Returns the OpenID Provider metadata. Should never benullafter afterdoPreExecutehas been called.- Returns:
- The provider metadata context.
-
setRelyingPartyContextLookupStrategy
public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext, RelyingPartyContext> strategy) Set the strategy used to locate theRelyingPartyContextassociated with a givenProfileRequestContext.- Parameters:
strategy- lookup strategy
-
setProviderMetadataLookupStrategy
public void setProviderMetadataLookupStrategy(@Nonnull Function<MessageContext, OIDCProviderMetadataContext> strategy) Set the lookup strategy to locate the OpenID providers metadata.- Parameters:
strategy- the strategy.
-
adapt
@Nullable protected <T> Function<MessageContext,T> adapt(@Nullable Function<ProfileRequestContext, T> function) Adapt aProfileRequestContextfunction to aMessageContextfunction via composing with a lookup function.- Type Parameters:
T- the output type of the functions- Parameters:
function- the profile request context function- Returns:
- the message context function
-
lookupProfileRequestContext
@Nullable protected ProfileRequestContext lookupProfileRequestContext(@Nonnull MessageContext messageContext) Lookup the profile request context from the given message context using the functionPRC_LOOKUP.- Parameters:
messageContext- the message context to find the profile request context from- Returns:
- the profile request context, or null if not found
-
adapt
@Nullable protected Predicate<MessageContext> adapt(@Nullable Predicate<ProfileRequestContext> predicate) Adapt aProfileRequestContextpredicate into aMessageContextpredicate via composing with a lookup function.- Parameters:
predicate- the profile request context predicate- Returns:
- the message context predicate
-
doPreInvoke
protected boolean doPreInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException - Overrides:
doPreInvokein classAbstractMessageHandler- Throws:
MessageHandlerException