Class AddJwksToClientMetadata

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 AddJwksToClientMetadata extends AbstractOIDCClientMetadataPopulationAction
An action that adds the jwks or jwks_uri to the client metadata, if one of those were defined in the request. Both cannot be defined, as specified in https://openid.net/specs/openid-connect-registration-1_0.html section 2.
  • Field Details

    • log

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

      @NonnullAfterInit private org.apache.hc.client5.http.classic.HttpClient httpClient
      The HttpClient to use.
    • httpClientSecurityParameters

      @Nullable private HttpClientSecurityParameters httpClientSecurityParameters
      HTTP client security parameters.
    • validateRemoteJwkSetPredicate

      @Nonnull private Predicate<ProfileRequestContext> validateRemoteJwkSetPredicate
      Predicate used to indicate whether contents of remote JWK set should be validated.
  • Constructor Details

    • AddJwksToClientMetadata

      public AddJwksToClientMetadata()
      Constructor.
  • Method Details

    • setHttpClient

      public void setHttpClient(@Nonnull org.apache.hc.client5.http.classic.HttpClient client)
      Set the HttpClient to use.
      Parameters:
      client - client to use
    • setHttpClientSecurityParameters

      public void setHttpClientSecurityParameters(@Nullable HttpClientSecurityParameters params)
      Set the optional client security parameters.
      Parameters:
      params - the new client security parameters
    • setValidateRemoteJwkSetPredicate

      public void setValidateRemoteJwkSetPredicate(@Nonnull Predicate<ProfileRequestContext> predicate)
      Set the predicate used to indicate whether contents of remote JWK set should be validated.
      Parameters:
      predicate - the predicate used to indicate whether contents of remote JWK set should be validated.
    • doInitialize

      public void doInitialize() throws ComponentInitializationException
      Overrides:
      doInitialize in class AbstractInitializableComponent
      Throws:
      ComponentInitializationException
    • doExecute

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

      protected boolean containsKeys(JWKSet jwkSet)
      Checks that the given JWK set contains at least one key.
      Parameters:
      jwkSet - The set of JWKs.
      Returns:
      True if the set contains at least one key, false otherwise.