Hi,
I'm using the 5.5.0 Java transport client and I'd like to submit a search request using the 'run as' feature, but I'm not sure how I go about it. Are there any examples available?
Thanks,
Aaron
Hi,
I'm using the 5.5.0 Java transport client and I'd like to submit a search request using the 'run as' feature, but I'm not sure how I go about it. Are there any examples available?
Thanks,
Aaron
Do something like this
Map<String, String> headers = new HashMap<>();
headers.put("Authorization", UsernamePasswordToken.basicAuthHeaderValue("your_user", new SecureString("password".toCharArray())));
headers.put("es-security-runas-user", "your_user_to_run_as");
client.filterWithHeader(headers).admin().cluster().prepareHealth().get();
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.