Class HTTPProviderConfigurationFetchingStrategy.OIDCProviderMetadataResponseHandler

java.lang.Object
net.shibboleth.oidc.metadata.impl.HTTPProviderConfigurationFetchingStrategy.OIDCProviderMetadataResponseHandler
All Implemented Interfaces:
org.apache.hc.core5.http.io.HttpClientResponseHandler<OIDCProviderMetadata>
Enclosing class:
HTTPProviderConfigurationFetchingStrategy

@Immutable @ThreadSafe public static final class HTTPProviderConfigurationFetchingStrategy.OIDCProviderMetadataResponseHandler extends Object implements org.apache.hc.core5.http.io.HttpClientResponseHandler<OIDCProviderMetadata>
The response handler for parsing the providers's configuration information into OIDCProviderMetadata.
  • Field Details

    • log

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

    • OIDCProviderMetadataResponseHandler

      public OIDCProviderMetadataResponseHandler()
  • Method Details

    • handleResponse

      @Nullable public OIDCProviderMetadata handleResponse(org.apache.hc.core5.http.ClassicHttpResponse response) throws IOException
      Specified by:
      handleResponse in interface org.apache.hc.core5.http.io.HttpClientResponseHandler<OIDCProviderMetadata>
      Throws:
      IOException
    • metadataValid

      private final boolean metadataValid(@Nonnull OIDCProviderMetadata metadata, @Nullable String issuerURL)
      Check the Issuer in the metadata is identical to the Issuer URL used to retrieve the metadata. *Note*, this just checks the Issuer URL starts with the Issuer value from the returned metadata, otherwise these values will never be equal. It is hard to make sense of section 4.3 OpenID Discovery 1.0.
      Parameters:
      metadata - the OpenID Provider metadata
      issuerURL - the issuerURL used to retrieve the metadata
      Returns:
      true if valid, false otherwise.
    • validateHttpResponse

      protected void validateHttpResponse(@Nonnull org.apache.hc.core5.http.ClassicHttpResponse response) throws ResolverException
      Validate the received HTTP response instance, such as checking for supported content types.
      Parameters:
      response - the received response
      Throws:
      ResolverException - if the response was not valid, or if there is a fatal error validating the response