Class JwksClientConfigurationProperties

java.lang.Object
io.micronaut.security.token.jwt.signature.jwks.JwksClientConfigurationProperties
All Implemented Interfaces:
JwksClientConfiguration

@ConfigurationProperties("micronaut.security.token.jwt.signatures.jwks-client") public class JwksClientConfigurationProperties extends Object implements JwksClientConfiguration
ConfigurationProperties implementation of JwksClientConfiguration.
Since:
5.5.2
Author:
Sergio del Amo
  • Field Details

    • PREFIX

      public static final String PREFIX
      See Also:
    • DEFAULT_FAILURE_BACKOFF

      public static final Duration DEFAULT_FAILURE_BACKOFF
      The default failure back-off: 10 seconds.
    • DEFAULT_RETRIEVAL_TIMEOUT

      public static final Duration DEFAULT_RETRIEVAL_TIMEOUT
      The default retrieval timeout: 30 seconds.
  • Constructor Details

    • JwksClientConfigurationProperties

      public JwksClientConfigurationProperties()
  • Method Details

    • getFailureBackoff

      public @NonNull Duration getFailureBackoff()
      Description copied from interface: JwksClientConfiguration
      How long a remote JWK Set is not requested again after a retrieval failed or returned no keys. A zero or negative duration disables the back-off.
      Specified by:
      getFailureBackoff in interface JwksClientConfiguration
      Returns:
      The failure back-off duration.
    • getRetrievalTimeout

      public @NonNull Duration getRetrievalTimeout()
      Description copied from interface: JwksClientConfiguration
      How long a remote JWK Set retrieval may take before it is given up and treated as a failure. It bounds the retrieval shared by concurrent callers even when the underlying JwksClient has no timeout of its own. A zero or negative duration disables the timeout.
      Specified by:
      getRetrievalTimeout in interface JwksClientConfiguration
      Returns:
      The retrieval timeout.
    • setRetrievalTimeout

      public void setRetrievalTimeout(@NonNull Duration retrievalTimeout)
      How long a remote JWK Set retrieval may take before it is given up and treated as a failure, which starts the failure back-off. Concurrent callers share one retrieval per signature configuration and url, so without this timeout a retrieval which never completes (for example a JWKS client without timeouts of its own) would block every token for that configuration. Set it to 0 to disable the timeout. Default value (30 seconds).
      Parameters:
      retrievalTimeout - The retrieval timeout.
    • setFailureBackoff

      public void setFailureBackoff(@NonNull Duration failureBackoff)
      How long a remote JWK Set is not requested again after a retrieval failed (for example, connection refused, non-2xx response or unparseable body) or returned no keys. While the back-off lasts, tokens which cannot be verified with another signature configuration are rejected without contacting the JWKS endpoint again. Set it to 0 to disable the back-off. Default value (10 seconds).
      Parameters:
      failureBackoff - The failure back-off duration.