users@glassfish.java.net

Glassfish, JAAS, and EJB 3.0

From: <glassfish_at_javadesktop.org>
Date: Fri, 04 Jun 2010 07:14:54 PDT

Hey all,

First time poster on here, have a problem that I honestly can't believe that no one has ever run into before.

So, I have an EJB 3.0 project that I deploy in Glassfish 2.x to create and access my databases I need. I would like to use JAAS as a means to securely allow for users to log into the front end and restrict access to the session beans based upon the roles that they are assigned. Problem is, I can't seem to find anyone that has attempted to use EJB's with a custom Realm in Glassfish to be able to implement this. The issue seems to be that Glassfish calls the JAAS init() method before the EJB's have had a chance to deploy, and thus the database tables are not always guaranteed to be there so I can't read the usernames and passwords that are needed out of the table. I would prefer not to use a file realm if possible, so what sort of options would you all have for me with these restrictions stated above?

Thanks ahead of time.
[Message sent by forum member 'kenundrumz2100']

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