Class HTTPProxyAuthenticator2

    • Field Detail

      • log

        protected final org.apache.logging.log4j.Logger log
    • Constructor Detail

      • HTTPProxyAuthenticator2

        public HTTPProxyAuthenticator2​(org.elasticsearch.common.settings.Settings settings,
                                       Path configPath)
    • Method Detail

      • extractCredentials

        public AuthCredentials extractCredentials​(org.elasticsearch.rest.RestRequest restRequest,
                                                  org.elasticsearch.common.util.concurrent.ThreadContext threadContext)
        Description copied from interface: HTTPAuthenticator
        Extract AuthCredentials from RestRequest
        Specified by:
        extractCredentials in interface HTTPAuthenticator
        Parameters:
        restRequest - The rest request
        threadContext - The current thread context
        Returns:
        The authentication credentials (complete or incomplete) or null when no credentials are found in the request

        When the credentials could be fully extracted from the request .markComplete() must be called on the AuthCredentials which are returned. If the authentication flow needs another roundtrip with the request originator do not mark it as complete.

      • reRequestAuthentication

        public boolean reRequestAuthentication​(org.elasticsearch.rest.RestChannel restChannel,
                                               AuthCredentials authCredentials)
        Description copied from interface: HTTPAuthenticator
        If the extractCredentials() call was not successful or the authentication flow needs another roundtrip this method will be called. If the custom HTTP authenticator does not support this method is a no-op and false should be returned. If the custom HTTP authenticator does support re-request authentication or supports authentication flows with multiple roundtrips then the response should be sent (through the channel) and true must be returned.
        Specified by:
        reRequestAuthentication in interface HTTPAuthenticator
        Parameters:
        restChannel - The rest channel to sent back the response via channel.sendResponse()
        authCredentials - The credentials from the prior authentication attempt
        Returns:
        false if re-request is not supported/necessary, true otherwise. If true is returned channel.sendResponse() must be called so that the request completes.