Class AbstractHttpOIDCAuthenticationAction<T>

    • Field Detail

      • log

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

        @NonnullAfterInit
        private Function<ProfileRequestContext,​org.apache.http.client.methods.HttpUriRequest> httpRequestEncoderStrategy
        The message encoder to encode the HTTP request into a HttpUriRequest.
      • httpResponseDecoderStrategy

        @NonnullAfterInit
        private Function<org.apache.http.HttpResponse,​T> httpResponseDecoderStrategy
        The message decoder to decode the HTTP response.
      • httpClient

        @NonnullAfterInit
        private org.apache.http.client.HttpClient httpClient
        HttpClient for contacting the endpoint.
      • httpClientSecurityParameters

        @Nullable
        private HttpClientSecurityParameters httpClientSecurityParameters
        HTTP client security parameters.
    • Constructor Detail

      • AbstractHttpOIDCAuthenticationAction

        public AbstractHttpOIDCAuthenticationAction()
    • Method Detail

      • getHttpRequestEncoderStrategy

        @NonnullAfterInit
        public Function<ProfileRequestContext,​org.apache.http.client.methods.HttpUriRequest> getHttpRequestEncoderStrategy()
        Get the HTTP request encoder strategy.
        Returns:
        the request encoder.
      • getHttpResponseDecoderStrategy

        @NonnullAfterInit
        public Function<org.apache.http.HttpResponse,​T> getHttpResponseDecoderStrategy()
        Get the HTTP response decoder strategy.
        Returns:
        the response decoder.
      • setHttpResponseDecoderStrategy

        public void setHttpResponseDecoderStrategy​(@Nonnull
                                                   Function<org.apache.http.HttpResponse,​T> strategy)
        Set the strategy used to map a HTTP response the response type.
        Parameters:
        strategy - the strategy
      • setHttpRequestEncoderStrategy

        public void setHttpRequestEncoderStrategy​(@Nonnull
                                                  Function<ProfileRequestContext,​org.apache.http.client.methods.HttpUriRequest> strategy)
        Set the strategy used to map a HTTP request to a HttpUriRequest object.
        Parameters:
        strategy - the strategy
      • setHttpClient

        public void setHttpClient​(@Nonnull
                                  org.apache.http.client.HttpClient client)
        Set the HttpClient to use.
        Parameters:
        client - client to use
      • setHttpClientSecurityParameters

        public void setHttpClientSecurityParameters​(@Nullable
                                                    HttpClientSecurityParameters params)
        Set the optional client security parameters.
        Parameters:
        params - the new client security parameters
      • handleRequest

        @Nonnull
        protected T handleRequest​(@Nonnull
                                  ProfileRequestContext profileRequestContext,
                                  @Nullable
                                  AbstractAuthenticatableOIDCContext authenticatableContext)
                           throws OIDCRPException
        Encode the request using the supplied request encoder strategy. Execute a synchronous HTTP request and decode the response using the supplied decoder strategy.
        Parameters:
        profileRequestContext - the context to pull information out of for encoding the request.
        authenticatableContext - an authenticatable context to set the authenticated flag. Can be null if no flag is supplied.
        Returns:
        the decoded response.
        Throws:
        OIDCRPException - on error making the request.
      • executeHttpRequest

        @Nonnull
        protected org.apache.http.HttpResponse executeHttpRequest​(@Nonnull
                                                                  org.apache.http.client.methods.HttpUriRequest request,
                                                                  @Nullable
                                                                  AbstractAuthenticatableOIDCContext authenticatableContext)
                                                           throws IOException
        Performs a call to an HTTP endpoint using the configured HttpClient and security parameters.
        Parameters:
        request - the prepared HTTP request
        authenticatableContext - an authenticatable context to set the authenticated flag. Can be null if no flag is supplied.
        Returns:
        the HTTP response, never null.
        Throws:
        IOException - if there is an error producing a response