Failed to bind properties under 'spring.datasource.password' to java.lang.String`
See original GitHub issuegetting several errors I have tried setting this up with first option it says
"encryptable properties will be enabled across the entire Spring Environment "
I am not sure where to put the password or how it knows what the password is to decrypt it
I have the encoded input in my property file like so
spring.datasource.password=ENC(du+QBwMsZb4kXSQI/eIL1RU46vtOgYZU)
Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.datasource.password' to java.lang.String
Caused by: org.springframework.cache.Cache$ValueRetrievalException: Value for key 'spring.datasource.password' could not be loaded using 'com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySourc
Caused by: java.lang.IllegalStateException: either 'jasypt.encryptor.password' or one of ['jasypt.encryptor.privateKeyString', 'jasypt.encryptor.privateKeyLocation'] must be provided for Password-based or Asymmetric encryption
Issue Analytics
- State:
- Created 4 years ago
- Comments:30 (4 by maintainers)
Top GitHub Comments
If you were using default config before 3.0.0 (Major release, breaking changes) you need to set:
Since the default algorithm changed, to keep your encrypted properties. Otherwise, you have to re-encrypt your properties.
Hey guys… I faced the same problem as you all… I managed to make it work by doing the following:
1st: encrypt your password using PBEWithMD5AndTripleDES algorithm, example:
./encrypt.sh input="admin123" password=<myEncryptionPassword> algorithm=PBEWithMD5AndTripleDES
2st: After doing that, in your application.properties include these properties:
It worked fine for me. Im using: jasypt-spring-boot-starter 3.0.3 spring-boot 2.4.2
Hope that help you guys. Cheers