Class AbstractTokenConsumerResponseAction

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

public abstract class AbstractTokenConsumerResponseAction extends AbstractApplicationAction
Base class for protocol-specific "token consumer" flow actions that prepare the response for the agent when completing processing.

This class operates on the principle that most of the output of a consumer flow consists of an AttributeContext containing the data making up the results together with opaque data that accompanies the results in order to allow the agent to store and return any protocol-specific data needed for subsequent operations, primarily logout.

Subclasses are responsible for carrying out certain tasks that will be protocol- specific, such as accessing protocol state needed to recover the original resource.

The agent response will generally contain an HTTP response structure capturing a redirect to the recovered URL, the serialized attribute data, and the opaque session data.

If the response is "committed" prior to this action, then the redirect portion will be skipped in favor of the previous response.

Event:
EventIds.PROCEED_EVENT_ID
Precondition:
AgentRequestContext.getOutput().isstruct()
,
AgentRequestContext.getRemotedServletResponse() != null
  • Field Details

  • Constructor Details

    • AbstractTokenConsumerResponseAction

      public AbstractTokenConsumerResponseAction()
      Constructor.
  • Method Details

    • setAttributeContextLookupStrategy

      public void setAttributeContextLookupStrategy(@Nonnull Function<ProfileRequestContext,AttributeContext> strategy)
      Set the strategy used to locate the AttributeContext with the results.
      Parameters:
      strategy - lookup strategy
    • setStateDataContextLookupStrategy

      public void setStateDataContextLookupStrategy(@Nonnull Function<ProfileRequestContext,StateDataContext> strategy)
      Sets the strategy used to lookup the StateDataContext.
      Parameters:
      strategy - lookup strategy
    • doPreExecute

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

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

      @Nullable protected abstract DDF getSessionData(@Nonnull ProfileRequestContext profileRequestContext)
      Get the opaque session data that the agent should bind to any session it creates for later use.
      Parameters:
      profileRequestContext - profile request context
      Returns:
      opaque session data as a DDF node, or null if no session data is provided
    • getSessionNotOnOrAfter

      @Nullable protected Instant getSessionNotOnOrAfter(@Nonnull ProfileRequestContext profileRequestContext)
      Get a timestamp for the expiration of the session directed by the authentication token, if any.
      Parameters:
      profileRequestContext - profile request context
      Returns:
      session expiration time or null