Class AbstractAuthenticationRequestParameterValueMessageHandler<T>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.handler.AbstractMessageHandler
net.shibboleth.oidc.profile.messaging.handler.impl.AbstractAuthenticationRequestParameterValueMessageHandler<T>
- Type Parameters:
T- the authentication request parameter value type
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MessageHandler
- Direct Known Subclasses:
AddAuthenticationContextClassReferencesHandler,AddDisplayHandler,AddEndpointURIHandler,AddForceAuthenticationHandler,AddLoginHintHandler,AddMaxAgeHandler,AddNonceHandler,AddPKCECodeVerifierAndChallenge,AddPromptHandler,AddRedirectURIHandler,AddRequestedClaimsHandler,AddResourceHandler,AddResponseModeHandler,AddResponseTypeHandler,AddScopesHandler,AddStateHandler,AddUiLocalesHandler,BuildPlainRequestObjectJWT,SetAuthenticationRequestTimeHandler
public abstract class AbstractAuthenticationRequestParameterValueMessageHandler<T>
extends AbstractMessageHandler
Base class for message handlers that process and apply values of OpenID Connect authentication request parameters.
This abstract class provides common functionality for locating:
- the
OIDCAuthenticationRequestassociated with the currentMessageContext, - the
OIDCProviderMetadatadescribing the peer OpenID Provider, - and the parameter value to be extracted and validated against the expected Java type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionStrategy used to locate theOIDCAuthenticationRequest.private OIDCAuthenticationRequestThe stashedOIDCAuthenticationRequest.private Function<MessageContext,T> Lookup strategy for parameter value.protected static final ParentProfileRequestContextLookup<MessageContext>Lookup function for parent ProfileRequestContext.private com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadataThe stashed OpenID Provider metadata .Lookup strategy to locate the OpenID Provider metadata to use.The authentication request parameter value type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleandoPreInvoke(MessageContext messageContext) protected OIDCAuthenticationRequestGet the authentication request.protected TgetParameterValue(MessageContext context) Retrieves the parameter value or configuration options from the configured lookup strategy, verifying at runtime that the result matches the type expected by the subclass.protected com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadataReturns the OpenID Provider metadata.voidSet the strategy used to locate theOIDCAuthenticationRequestto use.voidsetParameterValueLookupStrategy(Function<MessageContext, T> strategy) Set the parameter value lookup strategy used to find the value to set onto the authentication request.voidSet the lookup strategy to locate the OpenID providers metadata.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. -
authenticationRequestLookupStrategy
@Nonnull private Function<MessageContext,OIDCAuthenticationRequest> authenticationRequestLookupStrategyStrategy used to locate theOIDCAuthenticationRequest. -
providerMetadataLookupStrategy
@Nonnull private Function<MessageContext,OIDCProviderMetadataContext> providerMetadataLookupStrategyLookup strategy to locate the OpenID Provider metadata to use. -
parameterValueLookupStrategy
Lookup strategy for parameter value. -
type
The authentication request parameter value type. -
authnRequest
The stashedOIDCAuthenticationRequest. -
providerMetadata
The stashed OpenID Provider metadata .
-
-
Constructor Details
-
AbstractAuthenticationRequestParameterValueMessageHandler
Constructor.- Parameters:
valueType- type of value returned by handler
-
-
Method Details
-
getAuthenticationRequest
Get the authentication request.- Returns:
- the authentication request
-
setProviderMetadataLookupStrategy
public void setProviderMetadataLookupStrategy(@Nonnull Function<MessageContext, OIDCProviderMetadataContext> strategy) Set the lookup strategy to locate the OpenID providers metadata.- Parameters:
strategy- the strategy.
-
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.
-
setParameterValueLookupStrategy
Set the parameter value lookup strategy used to find the value to set onto the authentication request.- Parameters:
strategy- The parameter value lookup strategy to set.
-
getParameterValue
Retrieves the parameter value or configuration options from the configured lookup strategy, verifying at runtime that the result matches the type expected by the subclass.- Parameters:
context- the message context to pass to the lookup function- Returns:
- the parameter value
- Throws:
MessageHandlerException- if the value is not the expected type
-
setAuthenticationRequestLookupStrategy
public void setAuthenticationRequestLookupStrategy(@Nonnull Function<MessageContext, OIDCAuthenticationRequest> strategy) Set the strategy used to locate theOIDCAuthenticationRequestto use.- Parameters:
strategy- lookup strategy
-
doPreInvoke
protected boolean doPreInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException - Overrides:
doPreInvokein classAbstractMessageHandler- Throws:
MessageHandlerException
-