DatabaseLogin help
worthe Jul 2, 2003 11:03 AMWe purchased the JBOSS documentation recently and I am still having some
authentication trouble. I think I am missing something simple. I have the spi.UsersRolesLoginModule working, but can not get the DatabaseServerLoginModule to work.
Specifically, the login seems to do something when I access the intro
jsp page, but I can not login and I am not sure if it connects or what. I thought I turned on the log4j debugging by changing log4j:configuration debug value to true. But I do not get any additional info. Do I have to add a new appender or something? Here is all the info I get on the login attempt :
12:20:35,374 INFO [MainDeployer] Deployed package:
file:/opt/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/mqosa.ear
12:22:33,012 INFO [JaasSecurityManagerService] Created
securityMgr=org.jboss.security.plugins.JaasSecurityManager@198a654
12:22:33,069 INFO [JaasSecurityManagerService] setCachePolicy,
c=org.jboss.util.TimedCachePolicy@1140db
12:22:33,114 INFO [JaasSecurityManagerService] Added MQOSA_DB,
org.jboss.security.plugins.SecurityDomainContext@b91602 to map
I am able to change database contents elsewhere using some CMP beans, so
I don't think the connection is a problem. However, I always go to the
failed login page. Is there a way to debug this, or can you think what
I am doing wrong?
I have configured the jboss.xml as follows :
<login-config>
<auth-method>FORM</auth-method>
<realm-name>JBoss JMX Console</realm-name>
<form-login-config>
<form-login-page>/jsp/login.jsp</form-login-page>
<form-error-page>/jsp/authenticationError.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>JBossAdmin</role-name>
</security-role>
and the jboss-web.xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<security-domain>java:/jaas/MQOSA_DB</security-domain>
</jboss-web>
and the server/deploy/conf/login_config.xml as follows:
<application-policy name = "MQOSA_DB">
<login-module
code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
flag = "required" >
<module-option name = "dsJndiName">WalterDS</module-option>
<module-option name = "principalsQuery">select password from
mqosa_user where login=?</module-option>
<module-option name = "rolesQuery">select role, 'Roles' from
role_user where login=?</module-option>
</login-module>
</application-policy>
I have spent a few days on this and would appreciate any help. The
users.properties/roles.properties login works, but we need it to be
dynamic.
Thanks for any help,
Peter Worthing