As part of my junit tests, I need a test to log in to my server using the
DatabaseServerLoginModule.
My client auth.conf has the following lines:
other {
// The JBoss LoginModule
org.jboss.security.ClientLoginModule required
;
};
My server login-config.xml contains the following section:
<application-policy name = "other">
<authentication>
<login-module code = "org.jboss.security.ClientLoginModule" flag
= "required"/>
<login-module code =
"org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
<module-option name =
"dsJndiName">java:/OracleDS</module-option>
<module-option name = "principalsQuery">SELECT password FROM
Users WHERE principal_id=?</module-option>
<module-option name = "rolesQuery">SELECT role, Role_group
from User_Roles WHERE principal_id=?</module-option>
</login-module>
</authentication>
</application-policy>
My client login code looks like this:
CallbackHandler handler = new UsernamePasswordHandler(username, password);
LoginContext lc = new LoginContext("other", handler);
lc.login();
Subject subj = lc.getSubject();
Symptoms:
On the client side, lc.getSubject().getPrincipals().size() is always 0,
meaning we aren't logged on.
On the client side, lc.login() with a bad password returns silently.
On the server side, context.getCallerPrincipal() gives the correct name,
even if the client thinks I'm logged in.
Questions:
1. How can I trigger my DatabaseServerLoginModule authentication for my
client?
2. I thought that lc.login() should throw a LoginException if the username
and password are bad. Why does this not happen?
3. I thought about putting the DatabaseServerLoginModule declaration into
the client auth,conf file, but I presume as this is a client, it can't do
the JNDI lookup on the DS name. Is this correct?
Ciao,
Jonathan O'Connor
Ph: +353 1 872 3305
Mob: +353 86 824 9736
Fax: +353 1 873 3612
-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T
handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user