Class AbstractLogoutRequestParameterValueMessageHandler<T>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.handler.AbstractMessageHandler
net.shibboleth.oidc.profile.messaging.handler.impl.AbstractLogoutRequestParameterValueMessageHandler<T>
- Type Parameters:
T- the logout request parameter value type TODO: move to commons
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MessageHandler
- Direct Known Subclasses:
AddClientIDHandler,AddIDTokenHintHandler,AddLogoutHintHandler,AddLogoutUILocalesHandler,AddPostLogoutRedirectURIHandler
public abstract class AbstractLogoutRequestParameterValueMessageHandler<T>
extends AbstractMessageHandler
Base class for message handlers that process and apply values of OpenID Connect logout requests.
This abstract class provides common functionality for locating:
- the
OIDCLogoutRequestassociated 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 TypeFieldDescriptionprivate OIDCLogoutRequestThe stashedOIDCLogoutRequest.private Function<MessageContext,OIDCLogoutRequest> Strategy used to locate theOIDCLogoutRequest.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 logout request parameter value type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractLogoutRequestParameterValueMessageHandler(Class<T> valueType) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected booleandoPreInvoke(MessageContext messageContext) protected OIDCLogoutRequestGet the logout 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 theOIDCLogoutRequestto use.voidsetParameterValueLookupStrategy(Function<MessageContext, T> strategy) Set the parameter value lookup strategy used to find the value to set onto the logout 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, 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. -
logoutRequestLookupStrategy
Strategy used to locate theOIDCLogoutRequest. -
providerMetadataLookupStrategy
@NonnullAfterInit private Function<MessageContext,OIDCProviderMetadataContext> providerMetadataLookupStrategyLookup strategy to locate the OpenID Provider metadata to use. -
parameterValueLookupStrategy
Lookup strategy for parameter value. -
type
The logout request parameter value type. -
logoutRequest
The stashedOIDCLogoutRequest. -
providerMetadata
The stashed OpenID Provider metadata .
-
-
Constructor Details
-
AbstractLogoutRequestParameterValueMessageHandler
Constructor.- Parameters:
valueType- type of value returned by handler
-
-
Method Details
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
getLogoutRequest
Get the logout request.- Returns:
- the logout 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 benullafterdoPreExecutehas been called.- Returns:
- The provider metadata context.
-
setParameterValueLookupStrategy
Set the parameter value lookup strategy used to find the value to set onto the logout request.- Parameters:
strategy- The parameter value lookup strategy to set.
-
getParameterValue
@Nullable protected T getParameterValue(@Nonnull MessageContext context) throws MessageHandlerException 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
-
setLogoutRequestLookupStrategy
public void setLogoutRequestLookupStrategy(@Nonnull Function<MessageContext, OIDCLogoutRequest> strategy) Set the strategy used to locate theOIDCLogoutRequestto use.- Parameters:
strategy- lookup strategy
-
doPreInvoke
protected boolean doPreInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException - Overrides:
doPreInvokein classAbstractMessageHandler- Throws:
MessageHandlerException
-