users@glassfish.java.net

Custom JAAS LoginModule with Application Client

From: <glassfish_at_javadesktop.org>
Date: Thu, 18 Feb 2010 06:44:00 PST

Hello,

I want to implement a custom LoginModule to authenticate with our local user database. Each user has a username, a password and a list of associated projects. The user can have a different role for each project. So the usual authentication process consists of two steps:
1. Ask for the username & password
2. Ask for project

The implementation as a jaas-LoginModule was pretty simple and works, but not within the glassfish application server. I know that I must extend AppservPasswordLoginModule, but then I can only retrieve a username and a password for the login. I read about Server authentication modules (SAM) in JSR 196 which can be used to accomplish more complex authentication tasks, but I don't know if I can use them as I am implementing an application client and not a web-application or webservices.

This leaves me asking some questions:
1. Can I use a SAM in combination with a application client? If yes: how?
2. Is there another way to integrate a LoginModule to the application server?
3. I have found found a method called setLoginModuleForAuthentication() inside the AppservPasswordLoginModule, but the method is not used within the AppservPasswordLoginModule. Is it just a fragment? Or can I use it to integrate my custom login module?

Thank you in advance
[Message sent by forum member 'muhkuh2k' (lukasjelonek_at_web.de)]

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