BAEL-4657: Add BasicAuthRequestInterceptor example
This commit is contained in:
parent
ff30703c8e
commit
d970484275
@ -2,6 +2,7 @@ package com.baeldung.cloud.openfeign.config;
|
||||
|
||||
import feign.Logger;
|
||||
import feign.RequestInterceptor;
|
||||
import feign.auth.BasicAuthRequestInterceptor;
|
||||
import feign.codec.ErrorDecoder;
|
||||
import feign.okhttp.OkHttpClient;
|
||||
import org.apache.http.entity.ContentType;
|
||||
@ -34,4 +35,9 @@ public class ClientConfiguration {
|
||||
requestTemplate.header("Accept", ContentType.APPLICATION_JSON.getMimeType());
|
||||
};
|
||||
}
|
||||
|
||||
// @Bean - uncomment to use this interceptor and remove @Bean from the requestInterceptor()
|
||||
public BasicAuthRequestInterceptor basicAuthRequestInterceptor() {
|
||||
return new BasicAuthRequestInterceptor("ajeje", "brazof");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user