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

    referencing encrypted connection factory passwords

    Richard Oates Newbie

      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">
       <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>

      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 ?