Class InitializeRequestedPrincipalContext

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

public class InitializeRequestedPrincipalContext
extends AbstractAuthenticationAction
An action that creates an RequestedPrincipalContext and attaches it to the current AuthenticationContext, if the profile request context contains a RelyingPartyContext with an AuthenticationProfileConfiguration containing one or more default authentication methods.

If such a context already exists, it is left in place unless setReplaceExistingContext(boolean) is set.

Event:
EventIds.PROCEED_EVENT_ID, IdPEventIds.INVALID_RELYING_PARTY_CTX, IdPEventIds.INVALID_PROFILE_CONFIG
Postcondition:
See above.
  • Field Details

  • Constructor Details

    • InitializeRequestedPrincipalContext

      public InitializeRequestedPrincipalContext()
      Constructor.
  • Method Details

    • setReplaceExistingContext

      public void setReplaceExistingContext​(boolean flag)
      Whether any existing RequestedPrincipalContext should be replaced, defaults to "false".

      Normally an existing context would indicate requirements that shouldn't be circumvented to comply with expected profile behavior.

      Parameters:
      flag - flag to set
    • setRelyingPartyContextLookupStrategy

      public void setRelyingPartyContextLookupStrategy​(@Nonnull Function<ProfileRequestContext,​RelyingPartyContext> strategy)
      Set the strategy used to locate the RelyingPartyContext associated with a given ProfileRequestContext.
      Parameters:
      strategy - strategy used to locate the RelyingPartyContext associated with a given ProfileRequestContext
    • doPreExecute

      protected boolean doPreExecute​(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
      Performs this authentication action's pre-execute step. Default implementation just returns true.
      Overrides:
      doPreExecute in class AbstractAuthenticationAction
      Parameters:
      profileRequestContext - the current IdP profile request context
      authenticationContext - the current authentication context
      Returns:
      true iff execution should continue
    • doExecute

      protected void doExecute​(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
      Performs this authentication action. Default implementation throws an exception.
      Overrides:
      doExecute in class AbstractAuthenticationAction
      Parameters:
      profileRequestContext - the current IdP profile request context
      authenticationContext - the current authentication context