I am trying to implement integration with elastic search on aws with RestHighLevelClient. the only supported authentication method I found is UsernamePasswordCredentials:
credentialsProvider.setCredentials(AuthScope.ANY,
new BasicSessionCredentials("test", "test"));
RestClientBuilder builder = RestClient.builder(
new HttpHost("localhost"))
.setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {
@Override
public HttpAsyncClientBuilder customizeHttpClient(
HttpAsyncClientBuilder httpClientBuilder) {
return httpClientBuilder
.setDefaultCredentialsProvider(credentialsProvider);
}
});
RestHighLevelClient restHighLevelClient = new RestHighLevelClient(builder)
I don't find a way to use RestHighLevelClient with BasicSessionCredentials which I plan to initialize this with assume role credentials