Package feign.auth

Class BasicAuthRequestInterceptor

  • All Implemented Interfaces:
    RequestInterceptor

    public class BasicAuthRequestInterceptor
    extends java.lang.Object
    implements RequestInterceptor
    An interceptor that adds the request header needed to use HTTP basic authentication.
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicAuthRequestInterceptor​(java.lang.String username, java.lang.String password)
      Creates an interceptor that authenticates all requests with the specified username and password encoded using ISO-8859-1.
      BasicAuthRequestInterceptor​(java.lang.String username, java.lang.String password, java.nio.charset.Charset charset)
      Creates an interceptor that authenticates all requests with the specified username and password encoded using the specified charset.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void apply​(RequestTemplate template)
      Called for every request.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BasicAuthRequestInterceptor

        public BasicAuthRequestInterceptor​(java.lang.String username,
                                           java.lang.String password)
        Creates an interceptor that authenticates all requests with the specified username and password encoded using ISO-8859-1.
        Parameters:
        username - the username to use for authentication
        password - the password to use for authentication
      • BasicAuthRequestInterceptor

        public BasicAuthRequestInterceptor​(java.lang.String username,
                                           java.lang.String password,
                                           java.nio.charset.Charset charset)
        Creates an interceptor that authenticates all requests with the specified username and password encoded using the specified charset.
        Parameters:
        username - the username to use for authentication
        password - the password to use for authentication
        charset - the charset to use when encoding the credentials