Class ValidateCodeChallenge

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

public class ValidateCodeChallenge extends AbstractOAuthAuthorizationResponseAction
Validates the presence of PKCE code challenge parameter from the incoming authentication request.
  • Field Details

    • log

      @Nonnull private org.slf4j.Logger log
      Class logger.
    • forcePKCECondition

      @Nonnull private Predicate<ProfileRequestContext> forcePKCECondition
      Strategy used to determine whether to require PKCE.
    • allowPKCEPlainCondition

      @Nonnull private Predicate<ProfileRequestContext> allowPKCEPlainCondition
      Strategy used to determine whether to allow plaintext PKCE.
    • codeChallengeLookupStrategy

      @Nonnull private Function<ProfileRequestContext,String> codeChallengeLookupStrategy
      Strategy used to locate the code challenge.
    • codeChallengeMethodLookupStrategy

      @Nonnull private Function<ProfileRequestContext,String> codeChallengeMethodLookupStrategy
      Strategy used to locate the code challenge method.
    • forcePKCE

      private boolean forcePKCE
      Whether PKCE is mandatory.
    • plainPKCE

      private boolean plainPKCE
      Whether plain PKCE is allowed.
    • codeChallenge

      @Nullable private String codeChallenge
      PKCE code challenge.
    • codeChallengeMethod

      @Nullable private String codeChallengeMethod
      PKCE code challenge method.
  • Constructor Details

    • ValidateCodeChallenge

      public ValidateCodeChallenge()
      Constructor.
  • Method Details

    • setForcePKCECondition

      public void setForcePKCECondition(@Nonnull Predicate<ProfileRequestContext> condition)
      Set the condition used to determine whether to require PKCE.
      Parameters:
      condition - condition to apply
    • setAllowPKCEPlainCondition

      public void setAllowPKCEPlainCondition(@Nonnull Predicate<ProfileRequestContext> condition)
      Set the condition used to determine whether to allow plaintext PKCE.
      Parameters:
      condition - condition to apply
    • setCodeChallengeLookupStrategy

      public void setCodeChallengeLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
      Set the strategy used to locate the Code Challenge of the request.
      Parameters:
      strategy - lookup strategy
    • setCodeChallengeMethodLookupStrategy

      public void setCodeChallengeMethodLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
      Set the strategy used to locate the Code Challenge Method of the request.
      Parameters:
      strategy - lookup strategy
    • doPreExecute

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

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