Class LookupRegisteredCredentialsFromUserHandle

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

public class LookupRegisteredCredentialsFromUserHandle extends AbstractWebAuthnAction<WebAuthnAuthenticationContext>
An action that lookups existing registered credentials from the userHandle supplied in the authenticators assertion response and sets them back onto the context. If no credentials exist and the trigger condition is set, an error event will be produced.

Also ensures the username found from the userHandle matches that in the authentication context if supplied e.g. for a passwordless authentication.

Event:
AuthnEventIds.INVALID_AUTHN_CTX
Postcondition:
BaseWebAuthnContext.setExistingCredentials() is either null if no existing credentials are found, or contains the credentials from the credential repository
  • Field Details

    • log

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

      private Predicate<ProfileRequestContext> triggerEventOnNoCredentialsPredicate
      Should an event be built if there are no credentials found?. Defaults to false.
    • noCredentialsEventId

      @Nonnull @NotEmpty private String noCredentialsEventId
      The EventID of the event to build if no credentials are found and triggerEventOnNoCredentialsPredicate evaluates to true.
    • repository

      The credential repository to use.
  • Constructor Details

    • LookupRegisteredCredentialsFromUserHandle

      public LookupRegisteredCredentialsFromUserHandle()
      Constructor.
  • Method Details

    • doInitialize

      protected void doInitialize() throws ComponentInitializationException
      Overrides:
      doInitialize in class AbstractWebAuthnAction<WebAuthnAuthenticationContext>
      Throws:
      ComponentInitializationException
    • setTriggerEventOnNoCredentials

      public void setTriggerEventOnNoCredentials(boolean trigger)
      Set a flag which triggers a custom event to be built if no credentials are found.
      Parameters:
      trigger - the flag to set
    • setTriggerEventOnNoCredentialsPredicate

      public void setTriggerEventOnNoCredentialsPredicate(@Nonnull Predicate<ProfileRequestContext> predicate)
      Set a predicate which triggers a custom event to be built if no credentials are found.
      Parameters:
      predicate - the flag to set
    • setNoCredentialsEventId

      public void setNoCredentialsEventId(@Nonnull @NotEmpty String eventId)
      Set the EventID of the event to build if no credentials are found and triggerEventOnNoCredentials is set.
      Parameters:
      eventId - the eventId to build.
    • doExecute

      protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull WebAuthnAuthenticationContext context)
      Performs this WebAuthn authentication action using the supplied WebAuthn context. Implementations should override this method.
      Overrides:
      doExecute in class AbstractWebAuthnAction<WebAuthnAuthenticationContext>
      Parameters:
      profileRequestContext - the current IdP profile request context
      context - the WebAuthn context