Class WellKnownOpenIdConfigurationFactory

java.lang.Object
org.forgerock.oauth.resolvers.WellKnownOpenIdConfigurationFactory

public class WellKnownOpenIdConfigurationFactory extends Object
This class creates JWKOpenIdResolverImpl's from a supplied well-known open id configuration url.
  • Constructor Details

    • WellKnownOpenIdConfigurationFactory

      @Deprecated public WellKnownOpenIdConfigurationFactory(int readTimeout, int connTimeout)
      Deprecated.
      Use org.forgerock.oauth.resolvers.WellKnownOpenIdConfigurationFactory# WellKnownOpenIdConfigurationFactory(org.forgerock.http.Client) instead
      Generates a factory that will use the given timeouts when attempting to read the data form a remote location.
      Parameters:
      readTimeout - set the read timeout of HTTP operations in this factory
      connTimeout - set the connection timeout of HTTP operations in this factory
    • WellKnownOpenIdConfigurationFactory

      public WellKnownOpenIdConfigurationFactory(Client client)
      Deprecated.
      Use org.forgerock.oauth.resolvers.WellKnownOpenIdConfigurationFactory# WellKnownOpenIdConfigurationFactory(org.forgerock.http.Client, java.time.Clock) instead
      Generates a factory that will use the given client when attempting to read the data form a remote location. Uses systemUTC by default for measuring timeouts.
      Parameters:
      client - the client to use
    • WellKnownOpenIdConfigurationFactory

      public WellKnownOpenIdConfigurationFactory(Client client, Clock clock)
      Generates a factory that will use the given client when attempting to read the data form a remote location.
      Parameters:
      client - the client to use
      clock - to use for measuring timeouts.
  • Method Details

    • buildAsync

      public Promise<JWKOpenIdResolverImpl,FailedToLoadJWKException> buildAsync(String configuredIssuer, URL configUrl)
      Returns a JWKOpenIdResolverImpl representing the contents of the supplied URL. Uses IssuerComparators.DEFAULT for comparing issuer values by exact string comparison.
      Parameters:
      configuredIssuer - The configured issuer's reference name
      configUrl - URL from which to read the JWKSet
      Returns:
      a promise of a usable JWKOpenIdResolverIMpl, or a FailedToLoadJWKException if there are issues reading or parsing the configUrl
    • buildAsync

      public Promise<JWKOpenIdResolverImpl,FailedToLoadJWKException> buildAsync(BiPredicate<String,String> issuerComparator, String configuredIssuer, URL configUrl)
      Returns a JWKOpenIdResolverImpl representing the contents of the supplied URL.
      Parameters:
      issuerComparator - The comparator for comparing the incoming issuer value against the expected value.
      configuredIssuer - The configured issuer's reference name
      configUrl - URL from which to read the JWKSet
      Returns:
      a promise of a usable JWKOpenIdResolverIMpl, or a FailedToLoadJWKException if there are issues reading or parsing the configUrl
    • build

      public JWKOpenIdResolverImpl build(String configuredIssuer, URL configUrl) throws FailedToLoadJWKException
      Returns a JWKOpenIdResolverImpl representing the contents of the supplied URL. Uses IssuerComparators.DEFAULT for comparing issuer values by exact string comparison.
      Parameters:
      configuredIssuer - The configured issuer's reference name
      configUrl - URL from which to read the JWKSet
      Returns:
      a usable JWKOpenIdResolverIMpl
      Throws:
      FailedToLoadJWKException - if there are issues reading or parsing the configUrl
    • build

      public JWKOpenIdResolverImpl build(BiPredicate<String,String> issuerComparator, String configuredIssuer, URL configUrl) throws FailedToLoadJWKException
      Returns a JWKOpenIdResolverImpl representing the contents of the supplied URL.
      Parameters:
      issuerComparator - The comparator for comparing the incoming issuer value against the expected value.
      configuredIssuer - The configured issuer's reference name
      configUrl - URL from which to read the JWKSet
      Returns:
      a usable JWKOpenIdResolverIMpl
      Throws:
      FailedToLoadJWKException - if there are issues reading or parsing the configUrl
    • getJwksStoreService

      public JwksStoreService getJwksStoreService()
      Get the JWKS store service.
      Returns:
      JWKS store service.