Merge pull request #10140 from kwoyke/BAEL-4657
BAEL-4657: Add BasicAuthRequestInterceptor example
This commit is contained in:
commit
dc8fe72bb5
|
@ -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…
Reference in New Issue