Interface AuthenticatingClientHttpRequestFactory

All Superinterfaces:
ClientHttpRequestFactory
All Known Implementing Classes:
HttpComponentsClientHttpRequestFactoryBasicAuth

public interface AuthenticatingClientHttpRequestFactory extends ClientHttpRequestFactory
Extension of the ClientHttpRequestFactory interface to allow authentication to be used with the REST client.
Since:
2.23.1
  • Method Details

    • getHost

      HttpHost getHost()
      Get the host to which the credentials will be applied.
      Returns:
      The HttpHost specification to which the authentication applies.
    • getCredentials

      Credentials getCredentials()
      Get the credentials currently in use.
      Returns:
      The credentials.
    • setCredentials

      void setCredentials(URL url, Credentials credentials)
      Set the credentials based on the protocol, host and port in the URL.
      Parameters:
      url - The URL of the HTTP server.
      credentials - The credentials to use, or null to reset.
      Throws:
      IllegalArgumentException - if url is null.
    • setCredentials

      void setCredentials(HttpHost host, Credentials credentials)
      Set the credentials based on the HTTP host specification.
      Parameters:
      host - The host specification of the HTTP server.
      credentials - The credentials to use, or null to reset.
      Throws:
      IllegalArgumentException - if host is null.