---
grails:
mongodb:
host: "localhost"
port: 27017
databaseName: "dbName"
username: "user"
password: "encryptedPassword"
---
How do I decrypt the password before it is used to make connection to MongoDB? The reason being that I don't need to specify plain-text password in my configuration.
Encrypting a password is security through obscurity, and could be hacked easily. I would recommend you using either external config file or system environment variable.
Another advantage of this approach is the fact that you don't need to recompile/modify your war every time you change the password.