Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7496347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:34:35+00:00 2026-05-29T18:34:35+00:00

Play framework [I’m using v1.2.3] does not support db password encryption stored in the

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:34:36+00:00Added an answer on May 29, 2026 at 6:34 pm

    Finally I fixed this by writing a Play Plugin. Writing a Play plugin is also very easy.
    Here is the sample code:

    package plugin;
    
    import java.util.Properties;
    
    import org.jasypt.util.text.StrongTextEncryptor;
    
    import play.Play;
    import play.PlayPlugin;
    
    public class DBPasswordInject extends PlayPlugin {
    
        @Override
        public void onConfigurationRead() {
            StrongTextEncryptor strongTextEncryptor = new StrongTextEncryptor();
            strongTextEncryptor.setPassword("$Look##$2");// this password has been used to encrypt
    
            String encryptedPassword = Play.configuration.getProperty("db.pass");
            String decrypted = strongTextEncryptor.decrypt(encryptedPassword);
            Play.configuration.setProperty("db.pass", decrypted); //override
    
            super.onConfigurationRead();
        }
    
    }
    

    The only downside is that I was not able to use org.jasypt.util.password.StrongPasswordEncryptor – because there is no decrypt method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Play Framework application that sends emails using SMTP server. Now I
I'm learning using Play Framework and doing a demo app for it. For this
Am trying to use MSSQL server with Play Framework, In my application.conf db.url=jdbc:microsoft:sqlserver://localhost\SQL2008:1433;DatabaseName=testDB db.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
In play framework application.conf there are lines: %test.db.url=jdbc:h2:mem:play;MODE=MYSQL;LOCK_MODE=0 %test.jpa.ddl=create But I am using MongoDB
For example, Play-framework supports RESTful services like this: RESTful on Play! framework How does
I'm using the Play Framework and taking a text from a textarea and I
Writing a Java application using the Play framework and need some HTTP-Live streaming. I
Play Framework does not follow Java Servlet specification. I am trying to understand how
Using Play Framework, you can do something like this: public static void mymethod() {
iam using AVFoundation Framework to play mp3 file ,everything works great ، i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.