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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleResponse(org.apache.hc.core5.http.ClassicHttpResponse response) private final booleanmetadataValid(OIDCProviderMetadata metadata, String issuerURL) Check the Issuer in the metadata is identical to the Issuer URL used to retrieve the metadata.protected voidvalidateHttpResponse(org.apache.hc.core5.http.ClassicHttpResponse response) Validate the received HTTP response instance, such as checking for supported content types.
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger.
-
-
Constructor Details
-
OIDCProviderMetadataResponseHandler
public OIDCProviderMetadataResponseHandler()
-
-
Method Details
-
handleResponse
@Nullable public OIDCProviderMetadata handleResponse(org.apache.hc.core5.http.ClassicHttpResponse response) throws IOException - Specified by:
handleResponsein interfaceorg.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 metadataissuerURL- 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
-