Class ProviderMetadataCredentialResolver

    • Field Detail

      • log

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

        private boolean isInitialized
        Initialization flag.
      • keyFetchInterval

        @Positive
        private Duration keyFetchInterval
        The remote key refresh interval. Default value: 30 minutes.
    • Constructor Detail

      • ProviderMetadataCredentialResolver

        public ProviderMetadataCredentialResolver()
    • Method Detail

      • setKeyFetchInterval

        public void setKeyFetchInterval​(@Positive
                                        Duration interval)
        Set the remote key refresh interval.
        Parameters:
        interval - What to set.
      • setRemoteJwkSetCache

        public void setRemoteJwkSetCache​(RemoteJwkSetCache jwkSetCache)
        Set the cache for remote JWK key sets.
        Parameters:
        jwkSetCache - What to set.
      • resolveFromMetadata

        @Nonnull
        protected Collection<Credential> resolveFromMetadata​(@Nonnull
                                                             CriteriaSet criteriaSet,
                                                             @Nonnull
                                                             com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata metadata)
        Fetch the remote JWK Set from the jwk_uri in the OpenID Provider's metadata. Convert each JWK into a Credential and return. Only supports EC (key agreement) and RSA (key encryption) keys.

        If a keyId is passed through in the criteria set, it is used as a parameter to the remote JWK cache. This ensures if the key is not found any cached keyset document, the document is re-fetched irrespective of the cache entry expiry.

        Parameters:
        criteriaSet - the criteria set
        metadata - the OpenID Provider's metadata
        Returns:
        a collection of credentials that represents EC and RSA keys in the remote JWK Set (if any)