Class InitializeDPoPProofContext

All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, ProfileAction, org.springframework.beans.factory.Aware, org.springframework.context.MessageSource, org.springframework.context.MessageSourceAware, org.springframework.webflow.execution.Action

public class InitializeDPoPProofContext extends AbstractOIDCRequestAction<Request>
Action that stores DPoP proof JWT to OAuth2DPoPProofContext. The value is extracted from the HTTP request header. If the DPoP-header contains a value, this action verifies that it's a single SignedJWT value as mandated by the specification.
Since:
4.2.0
  • Field Details

    • log

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

      @Nonnull private org.slf4j.Logger protocolMessageLog
      Used to log protocol messages.
    • requireDpopProofCondition

      @NonnullAfterInit private Predicate<ProfileRequestContext> requireDpopProofCondition
      Predicate for enforcing the use of DPoP proofs.
    • objectMapper

      @NonnullAfterInit private com.fasterxml.jackson.databind.ObjectMapper objectMapper
      Object mapper used for pretty-printing JWT contents.
  • Constructor Details

    • InitializeDPoPProofContext

      public InitializeDPoPProofContext()
  • Method Details

    • setRequireDpopProofCondition

      public void setRequireDpopProofCondition(@Nonnull Predicate<ProfileRequestContext> predicate)
      Set the predicate for enforcing the use of DPoP proofs.
      Parameters:
      predicate - the predicate for enforcing the use of DPoP proofs
    • setObjectMapper

      public void setObjectMapper(@Nonnull com.fasterxml.jackson.databind.ObjectMapper mapper)
      Set the object mapper used for pretty-printing JWT contents.
      Parameters:
      mapper - What to set.
    • doInitialize

      protected void doInitialize() throws ComponentInitializationException
      Overrides:
      doInitialize in class AbstractInitializableComponent
      Throws:
      ComponentInitializationException
    • doPreExecute

      protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)
      Overrides:
      doPreExecute in class AbstractOIDCRequestAction<Request>
    • doExecute

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

      @Nullable protected String getSingleValueOrNull(@Nullable Enumeration<String> enumeration)
      Returns the value from given enumeration if only single value exists, null otherwise.
      Parameters:
      enumeration - the input enumeration
      Returns:
      the single value if exists, null otherwise
    • doProtocolLog

      protected void doProtocolLog(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull JWT jwt, @Nonnull String messagePrefix)
      Create a protocol message containing the pretty-printed contents of the given JWT.
      Parameters:
      profileRequestContext - Profile request context where to publish possible error event
      jwt - The token to be logged
      messagePrefix - The prefix for the protocol log message