Announcement Announcement Module
Collapse
No announcement yet.
How to encrypt passwords in config files? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to encrypt passwords in config files?

    Is there a guide for how to accomplish encrypting passwords in Config.groovy and DataSource.groovy? Thanx

  • #2
    No. I have to admit this is the first time I've seen it requested. What sort of thing are you after? You can insert an encrypted string as a setting value and then decrypt it when you read the configuration setting in your application. That's basically the same approach as you would take with a properties file.

    I might be able to provide more information once I know exactly what you want to achieve.

    Comment


    • #3
      pledbrook

      thanx for replying. You know how in DataSource.groovy you put your password in so your app can connect to the DB? Im talking about putting an encrypted password in there instead of plain text.

      Ive seen this done is normal j2ee apps; i cant find any examples on how to do it though...

      Comment


      • #4
        I'd forgotten this feature had been requested some time ago. Check out the comments on this JIRA issue which give examples: http://jira.codehaus.org/browse/GRAILS-3620

        Comment


        • #5
          yes i got that from irc support. that will work for encrypting passwords in DataSource because the underlying datasource object can decrypt given a codec (the passwordEncryptionCodec on the config object), but what about other passwords in the config?

          Since groovy configs are code, i wonder if I can just invoke the codec manually?

          Comment


          • #6
            Yes, you can invoke any Groovy or Java code from the runtime configuration files as long as the relevant class is on the classpath.

            Comment


            • #7
              yep thats what the plan is. So seems like I have an approach to solve the problem...

              Comment


              • #8
                Hi , I was wondering if anyone has followed the article: http://jira.codehaus.org/browse/GRAILS-3620
                and tried to encrypt the db password in datasource.groovy, or any success at invoking a custome codec under utils directory in the grails config.
                Regards,
                Priyank

                Comment

                Working...
                X