Class AbstractDynamicHTTPFetchingStrategy<MetadataType>

    • Field Detail

      • MDC_ATTRIB_CURRENT_REQUEST_URI

        public static final String MDC_ATTRIB_CURRENT_REQUEST_URI
        MDC attribute representing the current request URI. Will be available during the execution of the configured ResponseHandler.
      • DEFAULT_CONTENT_TYPES

        private static final String[] DEFAULT_CONTENT_TYPES
        Default list of supported content MIME types.
      • log

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

        @Nonnull
        private final org.apache.http.client.HttpClient httpClient
        HTTP Client used to pull the configuration information.
      • supportedContentTypes

        @NonnullAfterInit
        private List<String> supportedContentTypes
        List of supported MIME types for use in Accept request header and validation of response Content-Type header.
      • supportedContentTypesValue

        @NonnullAfterInit
        private String supportedContentTypesValue
        Generated Accept request header value.
      • httpClientSecurityParameters

        @Nullable
        private HttpClientSecurityParameters httpClientSecurityParameters
        HTTP client security parameters.
      • responseHandler

        @Nonnull
        private final org.apache.http.client.ResponseHandler<MetadataType> responseHandler
        HttpClient ResponseHandler instance to use.
    • Constructor Detail

      • AbstractDynamicHTTPFetchingStrategy

        protected AbstractDynamicHTTPFetchingStrategy​(@Nonnull
                                                      org.apache.http.client.HttpClient client,
                                                      @Nonnull
                                                      org.apache.http.client.ResponseHandler<MetadataType> handler)
        Constructor.
        Parameters:
        client - the instance of HttpClient used to fetch remote OIDC metadata
        handler - the response handler used to convert the HTTP response to the metadata type.
    • Method Detail

      • setHttpClientSecurityParameters

        public void setHttpClientSecurityParameters​(@Nullable
                                                    HttpClientSecurityParameters params)
        Set an instance of HttpClientSecurityParameters which provides various parameters to influence the security behavior of the HttpClient instance.

        For all TLS-related parameters, must be used in conjunction with an HttpClient instance which is configured with either:

        For convenience methods for building a TLSSocketFactory, see HttpClientSupport.

        If the appropriate TLS socket factory is not configured and a trust engine is specified, then this will result in no TLS trust evaluation being performed and a ResolverException will ultimately be thrown.

        Parameters:
        params - the security parameters
      • getSupportedContentTypes

        @NonnullAfterInit
        @NotLive
        @Unmodifiable
        public List<String> getSupportedContentTypes()
        Get the list of supported MIME types for use in Accept request header and validation of response Content-Type header.
        Returns:
        the supported content types
      • setSupportedContentTypes

        public void setSupportedContentTypes​(@Nullable
                                             List<String> types)
        Set the list of supported MIME types for use in Accept request header and validation of response Content-Type header. Values will be effectively lower-cased at runtime.
        Parameters:
        types - the new supported content types to set
      • buildHttpClientContext

        private org.apache.http.client.protocol.HttpClientContext buildHttpClientContext​(@Nonnull
                                                                                         org.apache.http.client.methods.HttpUriRequest request)
        Build the HttpClientContext instance which will be used to invoke the HttpClient request.
        Parameters:
        request - the current HTTP request
        Returns:
        a new instance of HttpClientContext
      • buildHttpRequest

        @Nullable
        private org.apache.http.client.methods.HttpUriRequest buildHttpRequest​(@Nonnull
                                                                               CriteriaSet criteria)
        Build an appropriate instance of HttpUriRequest based on the input criteria set.
        Parameters:
        criteria - the input criteria set
        Returns:
        the newly constructed request, or null if it can not be built from the supplied criteria
      • buildRequestURL

        @Nullable
        protected abstract String buildRequestURL​(@Nonnull
                                                  CriteriaSet criteria)
        Build the request URL based on the input criteria set.
        Parameters:
        criteria - the input criteria set
        Returns:
        the request URL, or null if it can not be built based on the supplied criteria