Class AbstractWebAuthnExtractionAction

All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, ProfileAction, Aware, MessageSource, MessageSourceAware, Action
Direct Known Subclasses:
ExtractUsernameFromRegistrationForm

public class AbstractWebAuthnExtractionAction extends AbstractProfileAction
A base class for WebAuthn actions that extract a username for subsequent use.

The base class adds a common mechanism for applying regular expression transforms to the username prior to being added to the context tree.

Similar to AbstractExtractionAction, but without the requirement of it running inside an authentication flow.

  • Field Details

    • log

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

      @Nonnull private List<Pair<Pattern,String>> transforms
      Match patterns and replacement strings to apply.
    • uppercase

      private boolean uppercase
      Convert to uppercase prior to transforms?
    • lowercase

      private boolean lowercase
      Convert to lowercase prior to transforms?
    • trim

      private boolean trim
      Trim prior to transforms?
  • Constructor Details

    • AbstractWebAuthnExtractionAction

      public AbstractWebAuthnExtractionAction()
      Constructor.
  • Method Details

    • setTransforms

      public void setTransforms(@Nullable 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
    • applyTransforms

      @Nullable @NotEmpty protected String applyTransforms(@Nullable 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