users@glassfish.java.net

Deploying JAAS modules in EAR

From: <glassfish_at_javadesktop.org>
Date: Wed, 24 Sep 2008 09:26:59 PDT

Hello, I've got an EAR application in JBoss which uses JAAS as its authentication method. In that project, I have a custom JAAS login module based on my EJBs (using standard JPA). As the authentication for the module is entirely related only to the application, I don't want to touch any configuration file in the application server and include everything that I can in the deployed archive. To achieve this in JBoss, I can put everything in the ear with the following application.xml file:

...............................
<module>
    <ejb>Ejb3.jar</ejb>
  </module>
  <module>
    <ejb>LoginModule.jar</ejb>
  </module>
  <module>
    <java>jboss-service.xml</java>
  </module>
  <module>
    <web>
      <web-uri>AppPortal.war</web-uri>
      <context-root>AppPortal</context-root>
    </web>
  </module>
  <module>
    <web>
      <web-uri>AppAdmin.war</web-uri>
      <context-root>AppAdmin</context-root>
    </web>
  </module>
  <module>
    <web>
      <web-uri>AppWS.war</web-uri>
      <context-root></context-root>
    </web>
  </module>

The important part is that including the LoginModule.jar file that has the custom Login Module and jboss-service.xml file which has the JAAS configuration, I can deploy the EAR in any JBoss server and have it automatically configured without touching anything.
I know that, in order to port this application to Glassfish I have to implement a new Login Module but reading the documentation it seems that the only way to successfully use my module is editing the Glassfigh configuration files. Is there a way to include these configuration parts in the EAR and have them applied automatically like with JBoss?
[Message sent by forum member 'getaceres' (getaceres)]

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