Class ValidateSessionInitiatorRequest

All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, ProfileAction, Aware, MessageSource, MessageSourceAware, Action

public class ValidateSessionInitiatorRequest extends AbstractApplicationAction
Initiating action of a typical Session Initiator flow, this validates the input message for correctness, and may create a RelyingPartyContext based on the identity of the eventual authenticating authority (the IdP/OP/etc.) if this is part of the request.

The authority ID is potentially supplied by the agent in the request, or may be defaulted based on the Application.

Since it is not always required that the ID be known in advance (e.g., discovery flows, ECP), this is confgurable to allow session initiator flows to indicate via wiring how to handle this case.

In the case that a relying party is identified but not required, requirng a discovery response URL is an error, as such a case would result in a loop.

Event:
EventIds.PROCEED_EVENT_ID, EventIds.INVALID_PROFILE_CTX, EventIds.INVALID_MESSAGE, IdPEventIds.INVALID_RELYING_PARTY_CTX
  • Field Details

    • log

      @Nonnull private final org.slf4j.Logger log
      Class logger.
    • relyingPartyContextCreationStrategy

      @Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextCreationStrategy
      Creation strategy for RelyingPartyContext.
    • flowId

      @Nullable private String flowId
      Initiator flow indicator for logging.
    • requireRelyingPartyId

      private boolean requireRelyingPartyId
      Whether to require a relying party ID to exist.
    • requireDiscoveryURL

      private boolean requireDiscoveryURL
      Whether to require a discovery URL input parameter.
    • relyingPartyId

      @Nullable private String relyingPartyId
      The relying party name to base the inbound context on.
  • Constructor Details

    • ValidateSessionInitiatorRequest

      public ValidateSessionInitiatorRequest()
      Constructor.
  • Method Details

    • setFlowId

      public void setFlowId(@Nullable String id)
      Set initiator flow ID for logging.
      Parameters:
      id - flow ID
    • setRelyingPartyContextCreationStrategy

      public void setRelyingPartyContextCreationStrategy(@Nonnull Function<ProfileRequestContext,RelyingPartyContext> strategy)
      Set an optional lookup strategy to identify the relying party name, as a substitute for the session/logout assumptions made by the action otherwise.
      Parameters:
      strategy - lookup strategy
    • setRequireRelyingPartyId

      public void setRequireRelyingPartyId(boolean flag)
      Sets whether to require that a relying party ID be available.

      Defaults to true.

      Parameters:
      flag - flag to set
    • setRequireDiscoveryURL

      public void setRequireDiscoveryURL(boolean flag)
      Sets whether to require InitiatorConstants.DISCOVERY_RETURN_URL input parameter.
      Parameters:
      flag - flag to set
    • doPreExecute

      protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)
      Overrides:
      doPreExecute in class AbstractApplicationAction
    • doExecute

      protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)
      Overrides:
      doExecute in class AbstractProfileAction