Class HTTPProviderConfigurationFetchingStrategy

All Implemented Interfaces:
Function<CriteriaSet,com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata>, Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent

@ThreadSafe public class HTTPProviderConfigurationFetchingStrategy extends AbstractDynamicHTTPFetchingStrategy<com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata>
A dynamic strategy for fetching OpenID Connect Provider Configuration Metadata from its well-known location (OpenID Connect Discovery 1.0, section 4).
  • Field Details

    • CONTENT_TYPE

      @Nonnull private static final MediaType CONTENT_TYPE
      The returned content_type, must be application/json see openid-connect-discovery section 4.
    • DEFAULT_OPENID_PROVIDER_WELL_KNOWN_PATH

      @Nonnull @NotEmpty private static final String DEFAULT_OPENID_PROVIDER_WELL_KNOWN_PATH
      The default well-known path for OpenID Provider metadata.
      See Also:
    • log

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

      @Nonnull @NotEmpty private String wellKnownPath
      The well-known path for OpenID Provider metadata.
    • wellKnownLocationCompositionStrategy

      @Nonnull private BiFunction<com.nimbusds.oauth2.sdk.id.Issuer,String,String> wellKnownLocationCompositionStrategy
      Strategy for composing an issuer with the well-known configuration path.
  • Constructor Details

    • HTTPProviderConfigurationFetchingStrategy

      protected HTTPProviderConfigurationFetchingStrategy(@Nonnull org.apache.hc.client5.http.classic.HttpClient client, @Nonnull org.apache.hc.core5.http.io.HttpClientResponseHandler<com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata> handler)
      Constructor.
      Parameters:
      client - the HTTP client
      handler - response handler
  • Method Details

    • setWellKnownPath

      public void setWellKnownPath(@Nonnull @NotEmpty String path)
      Set the well-known URL path component.

      Defaults to "/.well-known/openid-configuration".

      Parameters:
      path - the path.
    • setWellKnownLocationCompositionStrategy

      public void setWellKnownLocationCompositionStrategy(@Nullable BiFunction<com.nimbusds.oauth2.sdk.id.Issuer,String,String> strategy)
      Set the well-known location composition strategy.
      Parameters:
      strategy - the strategy to set.
    • buildRequestURL

      protected String buildRequestURL(@Nullable CriteriaSet criteria)
      Build the request URL based on the input criteria set.
      Specified by:
      buildRequestURL in class AbstractDynamicHTTPFetchingStrategy<com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata>
      Parameters:
      criteria - the input criteria set
      Returns:
      the request URL, or null if it can not be built based on the supplied criteria