Class IssuerRepository

java.lang.Object
org.forgerock.openig.filter.oauth2.client.IssuerRepository

public class IssuerRepository extends Object
A repository to store and create all the OAuth2 issuers.
  • Method Details

    • findByName

      public Promise<? extends Issuer,DiscoveryException> findByName(String issuerName)
      Find a registered Issuer whose name matches issuerName.
      Parameters:
      issuerName - the name of the Issuer to find
      Returns:
      the issuer matching the given issuerName or null if none found.
    • findBySupportedDomainNames

      public Promise<? extends Issuer,DiscoveryException> findBySupportedDomainNames(String givenDomainName)
      Find a registered Issuer that supports the given {code domainName}. The given domain name can match one or none domain names supported by Issuers declared in this route. If the given domain name matches the patterns given by an Issuer 'supportedDomains' attributes, then the corresponding Issuer is returned to be used.
      Parameters:
      givenDomainName - The domain name to match from the registered domain names.
      Returns:
      A promise completed with either an OAuth 2.0 issuer on success or a DiscoveryException on failure
    • registerAsync

      public Promise<? extends Issuer,DiscoveryException> registerAsync(String issuerName, List<Pattern> supportedDomains, Supplier<Promise<? extends Issuer,DiscoveryException>> supplier)
      Tries to find an already registered Issuer named issuerName. If none is found, then build a new Issuer based on its async supplier. Furthermore, this Issuer will be associated to the provided domain names.
      Parameters:
      issuerName - The issuer's identifier. Usually, it's the host name or a given name.
      supportedDomains - List of the supported domains for this issuer.
      supplier - The Async supplier of an issuer. Will only be called if the issuer is not already registered
      Returns:
      A promise completed with either an OAuth 2.0 issuer on success or a DiscoveryException on failure