Class InitializeAuthenticationContext

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

public class InitializeAuthenticationContext extends AbstractProfileAction
An action that creates an AuthenticationContext and attaches it to the current ProfileRequestContext.

If the incoming message is a SAML 2.0 AuthnRequest, then basic authentication policy (IsPassive, ForceAuthn, Scoping) is copied into the context from the request.

Event:
EventIds.PROCEED_EVENT_ID, EventIds.ACCESS_DENIED
Postcondition:
ProfileRequestContext.getSubcontext(AuthenticationContext.class) != true, SAML 2.0 AuthnRequest policy flags are (optionally) copied to the AuthenticationContext
  • Field Details

  • Constructor Details

    • InitializeAuthenticationContext

      public InitializeAuthenticationContext()
      Constructor.
  • Method Details

    • setRelyingPartyContextLookupStrategy

      public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext,RelyingPartyContext> strategy)
      Set the strategy used to return the RelyingPartyContext for configuration options.
      Parameters:
      strategy - lookup strategy
      Since:
      4.0.0
    • setForceAuthnPredicate

      public void setForceAuthnPredicate(@Nonnull Predicate<ProfileRequestContext> condition)
      Set the predicate to apply to derive the message-independent forced authn default.
      Parameters:
      condition - condition to set
      Since:
      3.4.0
    • setIgnoreScopingPredicate

      public void setIgnoreScopingPredicate(@Nonnull Predicate<ProfileRequestContext> condition)
      Set the predicate to apply to determine whether to ignore any inbound Scoping element.
      Parameters:
      condition - condition to set
      Since:
      4.0.0
    • setProxyCountLookupStrategy

      public void setProxyCountLookupStrategy(@Nonnull Function<ProfileRequestContext,Integer> strategy)
      Set the lookup function to apply to derive the proxy count from the configuration.
      Parameters:
      strategy - lookup strategy
      Since:
      4.0.0
    • setMaxAgeLookupStrategy

      public void setMaxAgeLookupStrategy(@Nonnull Function<ProfileRequestContext,Duration> strategy)
      Set the lookup function to apply to derive max-age from the configuration.
      Parameters:
      strategy - lookup strategy
      Since:
      5.2.0
    • setRequestLookupStrategy

      public void setRequestLookupStrategy(@Nonnull Function<ProfileRequestContext,AuthnRequest> strategy)
      Set the strategy used to locate the AuthnRequest to examine, if any.
      Parameters:
      strategy - strategy used to locate the AuthnRequest
    • doPreExecute

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

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

      private boolean processScoping(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
      Check an inbound AuthnRequest for a Scoping element.
      Parameters:
      profileRequestContext - current profile request context
      authenticationContext - the context to populate
      Returns:
      true iff processing should continue