gstackoverflow
gstackoverflow

Reputation: 37106

Is there way to encrypt ldap password in spring boot application ? (at least base64)

In my spring boot application I have following configuration for LDAP

ldap:
  connection:
    host: 123.45.67.89
    port: 389
    user: CN=Administrator,CN=Users,DC=MYCOMPANY,DC=COM
    password: SuPeRsEcrEt123#

Is there way to encrypt LDAP password ? at least Base64

Upvotes: -1

Views: 321

Answers (1)

Lee Greiner
Lee Greiner

Reputation: 1082

You can use Spring Cloud Config to do this.

  1. Include the spring-cloud-starter-config dependency.
  2. Install the Spring Boot CLI and add the Cloud CLI to it. See this and this.
  3. Encrypt your password by issuing the spring encrypt <string to encrypt> --key <encrypt key>.
  4. Replace the password in your properties file with the encrypted password and preface the password with '{cipher}'. See this.
  5. Start your application with -DENCRYPT_KEY=<encrypt key> or -Dencrypt.key=<encrypt key>.

Upvotes: 0

Related Questions