Class AbstractOIDCAuthenticationRequestActionMessageHandler
- java.lang.Object
-
- net.shibboleth.utilities.java.support.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 anWebFlowMessageHandlerAdaptorthat provides functions to make available various OIDC contexts.The
MessageContextwill either be INBOUND or OUTBOUND depending on the direction defined by the callingWebFlowMessageHandlerAdaptoraction.
-
-
Field Summary
Fields Modifier and Type Field Description private OIDCAuthenticationRequestauthnRequestOIDC authentication request built by the IdP.private NonnullSupplier<javax.servlet.http.HttpServletRequest>httpServletRequestSupplierCurrent HTTP request, if available.private org.slf4j.LoggerlogClass logger.private static ParentProfileRequestContextLookup<MessageContext>PRC_LOOKUPLookup function for parent ProfileRequestContext.private OIDCAuthenticationRelyingPartyProfileConfigurationprofileConfigurationApplicable profile configuration.private com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadataproviderMetadataOpenID Provider metadata .private Function<MessageContext,OIDCProviderMetadataContext>providerMetadataLookupStrategyLookup strategy to locate the OpenID Provider metadata to use.private Function<ProfileRequestContext,RelyingPartyContext>relyingPartyContextLookupStrategyLookup function for relying party context.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractOIDCAuthenticationRequestActionMessageHandler()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <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 OIDCAuthenticationRequestgetAuthenticationRequest()Returns the authentication request build by this IdP.javax.servlet.http.HttpServletRequestgetHttpServletRequest()Get the HTTP servlet request supplier.NonnullSupplier<javax.servlet.http.HttpServletRequest>getHttpServletRequestSupplier()Get the supplier for HTTP request if available.protected OIDCAuthenticationRelyingPartyProfileConfigurationgetProfileConfiguration()Returns the profile configuration associated with this request.protected com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadatagetProviderMetadata()Returns the OpenID Provider metadata.protected ProfileRequestContextlookupProfileRequestContext(MessageContext messageContext)Lookup the profile request context from the given message context using the functionPRC_LOOKUP.voidsetHttpServletRequestSupplier(NonnullSupplier<javax.servlet.http.HttpServletRequest> requestSupplier)Set the HTTP servlet request supplier.voidsetProviderMetadataLookupStrategy(Function<MessageContext,OIDCProviderMetadataContext> strategy)Set the lookup strategy to locate the OpenID providers metadata.voidsetRelyingPartyContextLookupStrategy(Function<ProfileRequestContext,RelyingPartyContext> strategy)Set the strategy used to locate theRelyingPartyContextassociated with a givenProfileRequestContext.-
Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doInvoke, doPostInvoke, doPostInvoke, getActivationCondition, getLogPrefix, invoke, setActivationCondition
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Field Detail
-
PRC_LOOKUP
@Nonnull private static final ParentProfileRequestContextLookup<MessageContext> PRC_LOOKUP
Lookup function for parent ProfileRequestContext.
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
providerMetadataLookupStrategy
@Nonnull private Function<MessageContext,OIDCProviderMetadataContext> providerMetadataLookupStrategy
Lookup strategy to locate the OpenID Provider metadata to use.
-
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategy
Lookup function for relying party context.
-
authnRequest
@Nullable private OIDCAuthenticationRequest authnRequest
OIDC authentication request built by the IdP.
-
providerMetadata
@Nullable private com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata providerMetadata
OpenID Provider metadata .
-
profileConfiguration
@Nullable private OIDCAuthenticationRelyingPartyProfileConfiguration profileConfiguration
Applicable profile configuration.
-
httpServletRequestSupplier
@Nullable private NonnullSupplier<javax.servlet.http.HttpServletRequest> httpServletRequestSupplier
Current HTTP request, if available.
-
-
Method Detail
-
setHttpServletRequestSupplier
public void setHttpServletRequestSupplier(@Nullable NonnullSupplier<javax.servlet.http.HttpServletRequest> requestSupplier)Set the HTTP servlet request supplier.- Parameters:
requestSupplier- the supplier.
-
getHttpServletRequest
@Nullable public javax.servlet.http.HttpServletRequest getHttpServletRequest()
Get the HTTP servlet request supplier.- Returns:
- the HTTP servlet request supplier
-
getHttpServletRequestSupplier
@Nullable public NonnullSupplier<javax.servlet.http.HttpServletRequest> getHttpServletRequestSupplier()
Get the supplier for HTTP request if available.- Returns:
- current HTTP request
-
getAuthenticationRequest
@Nullable protected OIDCAuthenticationRequest getAuthenticationRequest()
Returns the authentication request build by this IdP. Should never benullafter afterdoPreExecutehas been called.- Returns:
- the authentication request.
-
getProfileConfiguration
@Nullable protected OIDCAuthenticationRelyingPartyProfileConfiguration getProfileConfiguration()
Returns the profile configuration associated with this request. Should never benullafterdoPreExecutehas been called.- Returns:
- the profile configuration
-
getProviderMetadata
@Nullable 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
-
-