Java REST Client Auth Security

Hi

Reading below link to implement Basic Authentication for my application to integrate with ElasticSearch
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/_basic_authentication.html

But, how to secure my password? I could not put my password in cleartext in the Java code.

new UsernamePasswordCredentials("user", "password"));

any help is appreciated.
Thanks

That is entirely up to you. How do you secure your passwords for other data sources?

You could read it from a file, read it from the classpath, access a secret store. Those are all possible here.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.