Class AbstractTOTPExtractionAction

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.authn.AbstractAuthenticationAction
net.shibboleth.idp.plugin.authn.totp.impl.AbstractTOTPExtractionAction
All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, ProfileAction, Aware, MessageSource, MessageSourceAware, Action
Direct Known Subclasses:
ExtractTOTPFromFormRequest, ExtractTOTPFromHeader

public abstract class AbstractTOTPExtractionAction extends net.shibboleth.idp.authn.AbstractAuthenticationAction
/** An action that derives a username from a lookup strategy, a TOTP code from an arbitrary source, creates a TOTPContext, and attaches it to the AuthenticationContext.
Event:
EventIds.PROCEED_EVENT_ID, AuthnEventIds.NO_CREDENTIALS, AuthnEventIds.UNKNOWN_USERNAME, AuthnEventIds.INVALID_CREDENTIALS
Precondition:
ProfileRequestContext.getSubcontext(AuthenticationContext.class) != null
Postcondition:
AuthenticationContext.getSubcontext(TOTPContext.class) != null
  • Field Details

    • log

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

      @Nonnull private Function<ProfileRequestContext,String> usernameLookupStrategy
      Lookup strategy for username to use in resolving token seeds.
    • totpContextCreationStrategy

      @Nonnull private Function<net.shibboleth.idp.authn.context.AuthenticationContext,TOTPContext> totpContextCreationStrategy
      Creation strategy for TOTP context.
    • totpContext

      @Nullable private TOTPContext totpContext
      TOTP context being operated on.
  • Constructor Details

    • AbstractTOTPExtractionAction

      public AbstractTOTPExtractionAction()
      Constructor.
  • Method Details

    • setUsernameLookupStrategy

      public void setUsernameLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
      Set the lookup strategy to use for the username to use in resolving token seeds.
      Parameters:
      strategy - lookup strategy
    • setTOTPContextCreationStrategy

      public void setTOTPContextCreationStrategy(@Nonnull Function<net.shibboleth.idp.authn.context.AuthenticationContext,TOTPContext> strategy)
      Set the lookup strategy to locate/create the TOTPContext.
      Parameters:
      strategy - lookup/creation strategy
    • doExecute

      protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)
      Overrides:
      doExecute in class net.shibboleth.idp.authn.AbstractAuthenticationAction
    • extractCode

      @Nullable protected abstract String extractCode(@Nonnull HttpServletRequest httpRequest)
      Gets the token code from the HTTP request.
      Parameters:
      httpRequest - current HTTP request
      Returns:
      the token code, or null