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

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3891020#3891020

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3891020


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to