Class ExtractUsernameFromRegistrationForm

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

public class ExtractUsernameFromRegistrationForm extends AbstractWebAuthnExtractionAction
An action to populate a username into the BaseWebAuthnContext.
Event:
AuthnEventIds.UNKNOWN_USERNAME
Precondition:
ProfileRequestContext.getSubcontext(BaseWebAuthnContext.class) != null
Postcondition:
BaseWebAuthnContext.getUsername() == null
  • Field Details

  • Constructor Details

    • ExtractUsernameFromRegistrationForm

      public ExtractUsernameFromRegistrationForm()
      Constructor.
  • Method Details

    • setWebAuthnContextLookupStrategy

      public void setWebAuthnContextLookupStrategy(@Nonnull Function<ProfileRequestContext,BaseWebAuthnContext> strategy)
      Set the strategy used to locate the BaseWebAuthnContext to operate on.
      Parameters:
      strategy - lookup strategy
    • setUsernameFieldName

      public void setUsernameFieldName(@Nonnull String name)
      Sets the name of the form field that carries the username.
      Parameters:
      name - field name
    • doPreExecute

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

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

      @Nullable private String getUsernameFromForm()
      Gets the username from a form submission.
      Returns:
      the raw submitted username
    • processUsername

      @Nullable private String processUsername(@Nonnull ProfileRequestContext profileRequestContext)
      Gets the username from a form submission and apply transformations to it.
      Parameters:
      profileRequestContext - profile request context
      Returns:
      submitted username, after applying any configured transforms