Class OIDCMetadata

java.lang.Object
org.apache.activemq.artemis.spi.core.security.jaas.oidc.OIDCMetadata

public class OIDCMetadata extends Object
Everything we need from /.well-known/openid-configuration endpoint - including the keys from the jwks_uri endpoint.
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Constructor Details

    • OIDCMetadata

      public OIDCMetadata(String expectedIssuer, org.apache.activemq.artemis.json.JsonObject json)
    • OIDCMetadata

      public OIDCMetadata(String expectedIssuer, org.apache.activemq.artemis.json.JsonObject json, boolean recoverable)
  • Method Details

    • shouldFetchAgain

      public boolean shouldFetchAgain(int metadataRetryTime)
      Whether this metadata should be refreshed because of metadataRetryTime in seconds
      Parameters:
      metadataRetryTime - delay between this metadata should fetched again (in seconds)
      Returns:
      true if the metadata should be fetched again
    • shouldRefreshPublicKeys

      public boolean shouldRefreshPublicKeys(int cacheKeysTime)
      Valid OIDC metadata contains jwks_uri which points to the endpoint from which we can get a "JWK set" = an array of keys in the format specified in RFC 7517 (JSON Web Key (JWK)). While we don't expect metadata to change (as of 2026-03-11), we're ready to refresh the signature keys sing a configured cache time.
      Parameters:
      cacheKeysTime - delay between fetching the keys from jwks_uri endpoint
      Returns:
      true if the keys should be fetched again from the provider's jwks_uri endpoint
    • currentSecurityContext

      public com.nimbusds.jose.proc.JWKSecurityContext currentSecurityContext()
      Retrieve current instance of JWKSecurityContext with a list of keys for JWT validation.
      Returns:
      JWKSecurityContext with currently known public keys
    • getIssuer

      public String getIssuer()
    • getJwksURI

      public URI getJwksURI()
    • configureKeys

      public void configureKeys(String json)
    • isValid

      public boolean isValid()
    • isRecoverable

      public boolean isRecoverable()
    • withException

      public OIDCMetadata withException(Exception issue)
    • getException

      public Exception getException()
    • withErrorMessage

      public OIDCMetadata withErrorMessage(String message)
    • getErrorMessage

      public String getErrorMessage()