Class AbstractSubjectCanonicalizationAction

All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, ProfileAction, Aware, MessageSource, MessageSourceAware, Action
Direct Known Subclasses:
AttributeSourcedSubjectCanonicalization, LegacyCanonicalization, NameIDCanonicalization, NameIdentifierCanonicalization, PopulateSubjectCanonicalizationContext, SelectSubjectCanonicalizationFlow, SimpleSubjectCanonicalization, X500SubjectCanonicalization

public abstract class AbstractSubjectCanonicalizationAction
extends AbstractProfileAction
A base class for subject canonicalization actions. In addition to the work performed by AbstractProfileAction, this action also looks up and makes available the SubjectCanonicalizationContext. Authentication action implementations should override doExecute(ProfileRequestContext, SubjectCanonicalizationContext)
Event:
AuthnEventIds.INVALID_SUBJECT_C14N_CTX
  • Field Details

  • Constructor Details

    • AbstractSubjectCanonicalizationAction

      public AbstractSubjectCanonicalizationAction()
      Constructor.
  • Method Details

    • setLookupStrategy

      public void setLookupStrategy​(@Nonnull Function<ProfileRequestContext,​SubjectCanonicalizationContext> strategy)
      Set the context lookup strategy.
      Parameters:
      strategy - lookup strategy function for SubjectCanonicalizationContext.
    • setTransforms

      public void setTransforms​(@Nullable @NonnullElements Collection<Pair<String,​String>> newTransforms)
      A collection of regular expression and replacement pairs.
      Parameters:
      newTransforms - collection of replacement transforms
    • setUppercase

      public void setUppercase​(boolean flag)
      Controls conversion to uppercase prior to applying any transforms.
      Parameters:
      flag - uppercase flag
    • setLowercase

      public void setLowercase​(boolean flag)
      Controls conversion to lowercase prior to applying any transforms.
      Parameters:
      flag - lowercase flag
    • setTrim

      public void setTrim​(boolean flag)
      Controls whitespace trimming prior to applying any transforms.
      Parameters:
      flag - trim flag
    • doPreExecute

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

      protected boolean doPreExecute​(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull SubjectCanonicalizationContext c14nContext)
      Performs this c14n action's pre-execute step. Default implementation just returns true iff a subject is set.
      Parameters:
      profileRequestContext - the current IdP profile request context
      c14nContext - the current subject canonicalization context
      Returns:
      true iff execution should continue
    • doExecute

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

      protected void doExecute​(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull SubjectCanonicalizationContext c14nContext)
      Performs this authentication action. Default implementation throws an exception.
      Parameters:
      profileRequestContext - the current IdP profile request context
      c14nContext - the current subject canonicalization context
    • applyTransforms

      @Nonnull @NotEmpty protected String applyTransforms​(@Nonnull @NotEmpty String input)
      Apply any configured regular expression replacements to an input value and return the result.
      Parameters:
      input - the input string
      Returns:
      the result of applying the expressions