Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection to 2 databases - Failed to load users/passwords/role files

 
San-Yih Pan
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I went through http://www.coderanch.com/t/90486/JBoss/Failed-load-users-passwords-role but have one question.

How to put 2 <security-domain> in "jboss-web.xml" because of 2 databases?

My login-config.xml is as follows:

<application-policy name="oracleds1">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
flag="required">
<module-option name="usersProperties">props/oracleds1-users.properties</module-option>
<module-option name="rolesProperties">props/oracleds1-roles.properties</module-option>
</login-module>
</authentication>
</application-policy>

<application-policy name="oracleds2">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
flag="required">
<module-option name="usersProperties">props/oracleds2-users.properties</module-option>
<module-option name="rolesProperties">props/oracleds2-roles.properties</module-option>
</login-module>
</authentication>
</application-policy>

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to create a third application-policy which chains those two application policies together (just add the two <authentication> entries ), and then reference that one policy in jboss-web.xml. This should help:
http://docs.jboss.org/jbosssecurity/docs/6.0/security_guide/html/Login_Modules.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic