Class AbstractLogoutRequestParameterValueMessageHandler<T>

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.handler.AbstractMessageHandler
net.shibboleth.sp.oidc.profile.impl.AbstractLogoutRequestParameterValueMessageHandler<T>
Type Parameters:
T - the logout request parameter value type TODO: move to commons
All Implemented Interfaces:
net.shibboleth.shared.component.Component, net.shibboleth.shared.component.DestructableComponent, net.shibboleth.shared.component.InitializableComponent, org.opensaml.messaging.handler.MessageHandler

public abstract class AbstractLogoutRequestParameterValueMessageHandler<T> extends org.opensaml.messaging.handler.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 OIDCLogoutRequest associated with the current MessageContext,
  • the OIDCProviderMetadata describing the peer OpenID Provider,
  • and the parameter value to be extracted and validated against the expected Java type.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private net.shibboleth.oidc.profile.core.OIDCLogoutRequest
    The stashed OIDCLogoutRequest.
    private Function<org.opensaml.messaging.context.MessageContext,net.shibboleth.oidc.profile.core.OIDCLogoutRequest>
    Strategy used to locate the OIDCLogoutRequest.
    private Function<org.opensaml.messaging.context.MessageContext,T>
    Lookup strategy for parameter value.
    protected static final org.opensaml.profile.context.navigate.ParentProfileRequestContextLookup<org.opensaml.messaging.context.MessageContext>
    Lookup function for parent ProfileRequestContext.
    private com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata
    The stashed OpenID Provider metadata .
    private Function<org.opensaml.messaging.context.MessageContext,net.shibboleth.oidc.metadata.context.OIDCProviderMetadataContext>
    Lookup strategy to locate the OpenID Provider metadata to use.
    private final Class<T>
    The logout request parameter value type.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    protected boolean
    doPreInvoke(org.opensaml.messaging.context.MessageContext messageContext)
     
    protected net.shibboleth.oidc.profile.core.OIDCLogoutRequest
    Get the logout request.
    protected T
    getParameterValue(org.opensaml.messaging.context.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.OIDCProviderMetadata
    Returns the OpenID Provider metadata.
    void
    setLogoutRequestLookupStrategy(Function<org.opensaml.messaging.context.MessageContext,net.shibboleth.oidc.profile.core.OIDCLogoutRequest> strategy)
    Set the strategy used to locate the OIDCLogoutRequest to use.
    void
    setParameterValueLookupStrategy(Function<org.opensaml.messaging.context.MessageContext,T> strategy)
    Set the parameter value lookup strategy used to find the value to set onto the logout request.
    void
    setProviderMetadataLookupStrategy(Function<org.opensaml.messaging.context.MessageContext,net.shibboleth.oidc.metadata.context.OIDCProviderMetadataContext> strategy)
    Set 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, setActivationCondition

    Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

    checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, 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.shared.component.InitializableComponent

    initialize, isInitialized
  • Field Details

    • PRC_LOOKUP

      @Nonnull protected static final org.opensaml.profile.context.navigate.ParentProfileRequestContextLookup<org.opensaml.messaging.context.MessageContext> PRC_LOOKUP
      Lookup function for parent ProfileRequestContext.
    • logoutRequestLookupStrategy

      @NonnullAfterInit private Function<org.opensaml.messaging.context.MessageContext,net.shibboleth.oidc.profile.core.OIDCLogoutRequest> logoutRequestLookupStrategy
      Strategy used to locate the OIDCLogoutRequest.
    • providerMetadataLookupStrategy

      @NonnullAfterInit private Function<org.opensaml.messaging.context.MessageContext,net.shibboleth.oidc.metadata.context.OIDCProviderMetadataContext> providerMetadataLookupStrategy
      Lookup strategy to locate the OpenID Provider metadata to use.
    • parameterValueLookupStrategy

      @Nullable private Function<org.opensaml.messaging.context.MessageContext,T> parameterValueLookupStrategy
      Lookup strategy for parameter value.
    • type

      @Nonnull private final Class<T> type
      The logout request parameter value type.
    • logoutRequest

      @NonnullBeforeExec private net.shibboleth.oidc.profile.core.OIDCLogoutRequest logoutRequest
      The stashed OIDCLogoutRequest.
    • providerMetadata

      @NonnullBeforeExec private com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata providerMetadata
      The stashed OpenID Provider metadata .
  • Constructor Details

    • AbstractLogoutRequestParameterValueMessageHandler

      protected AbstractLogoutRequestParameterValueMessageHandler(@Nonnull Class<T> valueType)
      Constructor.
      Parameters:
      valueType - type of value returned by handler
  • Method Details

    • doInitialize

      protected void doInitialize() throws net.shibboleth.shared.component.ComponentInitializationException
      Overrides:
      doInitialize in class net.shibboleth.shared.component.AbstractInitializableComponent
      Throws:
      net.shibboleth.shared.component.ComponentInitializationException
    • getLogoutRequest

      @NonnullBeforeExec protected net.shibboleth.oidc.profile.core.OIDCLogoutRequest getLogoutRequest()
      Get the logout request.
      Returns:
      the logout request
    • setProviderMetadataLookupStrategy

      public void setProviderMetadataLookupStrategy(@Nonnull Function<org.opensaml.messaging.context.MessageContext,net.shibboleth.oidc.metadata.context.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 be null after doPreExecute has been called.
      Returns:
      The provider metadata context.
    • setParameterValueLookupStrategy

      public void setParameterValueLookupStrategy(@Nonnull Function<org.opensaml.messaging.context.MessageContext,T> strategy)
      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 org.opensaml.messaging.context.MessageContext context) throws org.opensaml.messaging.handler.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:
      org.opensaml.messaging.handler.MessageHandlerException - if the value is not the expected type
    • setLogoutRequestLookupStrategy

      public void setLogoutRequestLookupStrategy(@Nonnull Function<org.opensaml.messaging.context.MessageContext,net.shibboleth.oidc.profile.core.OIDCLogoutRequest> strategy)
      Set the strategy used to locate the OIDCLogoutRequest to use.
      Parameters:
      strategy - lookup strategy
    • doPreInvoke

      protected boolean doPreInvoke(@Nonnull org.opensaml.messaging.context.MessageContext messageContext) throws org.opensaml.messaging.handler.MessageHandlerException
      Overrides:
      doPreInvoke in class org.opensaml.messaging.handler.AbstractMessageHandler
      Throws:
      org.opensaml.messaging.handler.MessageHandlerException