1 Reply Latest reply on Aug 24, 2005 3:24 AM by roates

    referencing encrypted connection factory passwords

    roates

      Following on from the discussion about how to encrypt connection factory passwords (see http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3820265#3820265), is it possible to read the username and password parameters defined in the login-config.xml from a properties file?

      The following is an excerpt from my login-config.xml file:

       <application-policy name = "OracleDBPassword">
       <authentication>
       <login-module code = "org.jboss.resource.security.SecureIdentityLoginModule"
       flag = "required">
       <module-option name = "username">${db.username}</module-option>
       <module-option name = "password">${db.password}</module-option>
       <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=OracleDS</module-option>
       </login-module>
       </authentication>
       </application-policy>
      


      When I try to use this, I get the following exception, which indicates that the SecureIdentityLoginModule is trying to decode the string ${db.password} instead of that property's value.

      2005-08-22 14:02:37,697 DEBUG [org.jboss.resource.security.SecureIdentityLoginModule] Failed to decode password
      java.lang.NumberFormatException: For input string: "$ {db.pa" <-- NB space added to avoid forum preview problem
       at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
       at java.lang.Integer.parseInt(Integer.java:468)
       at java.math.BigInteger.<init>(BigInteger.java:314)
       at org.jboss.resource.security.SecureIdentityLoginModule.decode(SecureIdentityLoginModule.java:152)
       at org.jboss.resource.security.SecureIdentityLoginModule.commit(SecureIdentityLoginModule.java:98)
       etc ...


      (As an aside, not so great to be logging this at DEBUG level ... ;-(


      Is it perhaps in general not possible to define property replacements in the login-config.xml ?


      thanks
      richard

        • 1. Re: referencing encrypted connection factory passwords
          roates

          ok, got this working by setting the properties db.username and db.password in run.bat (i.e. at JVM startup). Apparently the login-config.xml is read in before the PropertiesService gets going.

          Is there any documentation available about the startup order, i.e. which files will be read after PropertiesService has set any system Properties ?

          richard