users@glassfish.java.net

Re: glassfish and custom login module

From: <glassfish_at_javadesktop.org>
Date: Tue, 29 Jan 2008 02:53:15 PST

SOLUTION:

 I had in fact various problems:

 - nothing in the logs because I used log4j and a smtp log for exceptions. It was on my test machine, smtp failed and so did the log. Additionnally, I _could_ have checked the wrong log file (or too soon, I think it's somewhat asynchronous ; not sure though)
 - I now follow the examples http://developers.sun.com/appserver/reference/techart/as8_authentication/index.html for logging (although it's sun proprietary, again)
 - I tried to retrieve the _realm property in the constructor of the login module --> at this time, it's still "null", I needed to do that in authenticateUser()
 - it seems, although I don't guarantee it 100% (would need more tests) that this didn't work for me:
pm.login(username, password)

... replaced with pm.login(username, password, myRealm, true) --> ok (thanks scotty69)

 - various other mistakes that I could see when logging was working

 So, it's now working perfectly, as an application client (not a standalone app).

 Could still be better if this wasn't bound to sun proprietary stuff ;-)

scotty69, thanks for your input
[Message sent by forum member 'ymajoros' (ymajoros)]

http://forums.java.net/jive/thread.jspa?messageID=256293