Class ExchangeCodeForDuoToken

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

public class ExchangeCodeForDuoToken extends AbstractDuoAuthenticationAction
Action to exchange the authorization code in the Duo 2FA response for a Duo id_token that describes the result of 2FA. Once obtained, adds the token to the Duo context.
Event:
EventIds.PROCEED_EVENT_ID, AuthnEventIds.AUTHN_EXCEPTION, AuthnEventIds.NO_CREDENTIALS
Precondition:
ProfileRequestContext.getSubcontext(AuthenticationContext.class, false) != null and 
 AuthenticationContext.getSubcontect(DuoOIDCAuthenticationContext.class,false)!=null
Postcondition:
Add the Duo authentication token to the context.
  • Field Details

    • log

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

    • ExchangeCodeForDuoToken

      public ExchangeCodeForDuoToken()
  • Method Details

    • doExecute

      protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext, @Nonnull DuoOIDCAuthenticationContext duoContext)
      Description copied from class: AbstractDuoAuthenticationAction
      Performs this Duo authentication action using the supplied Duo context. Implementations should override this method.
      Overrides:
      doExecute in class AbstractDuoAuthenticationAction
      Parameters:
      profileRequestContext - the current IdP profile request context
      authenticationContext - the current authentication context
      duoContext - the Duo authentication context
    • logDecodedTokenPayload

      private void logDecodedTokenPayload(@Nullable com.nimbusds.jwt.JWT token)
      If the token is not encrypted, and the original parsed parts exist, log the payload base64url decoded. Otherwise do nothing.
      Parameters:
      token - the JWT