Play framework [I’m using v1.2.3] does not support db password encryption stored in the application.conf. This is stored as a plain-text file. DBPlugin reads this property and creates a Connection pool.
The requirement is to encrypt this password – for e.g. using Jasypt. Some enterprises enforce this as a security measure.
Has anybody tried doing something like this?
Since DBPlugin loads on ApplicationStart, there is no way to hack it. That leaves to write a custom plugin and onConfigurationRead set a new value for the db.password of application.conf property.
Any suggestions?
Finally I fixed this by writing a Play Plugin. Writing a Play plugin is also very easy.
Here is the sample code:
The only downside is that I was not able to use org.jasypt.util.password.StrongPasswordEncryptor – because there is no decrypt method.