Package feign.auth
Class BasicAuthRequestInterceptor
- java.lang.Object
-
- feign.auth.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.
-
-
-
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 authenticationpassword
- 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 authenticationpassword
- the password to use for authenticationcharset
- the charset to use when encoding the credentials
-
-
Method Detail
-
apply
public void apply(RequestTemplate template)
Description copied from interface:RequestInterceptor
Called for every request. Add data using methods on the suppliedRequestTemplate
.- Specified by:
apply
in interfaceRequestInterceptor
-
-