2 Replies Latest reply on Mar 16, 2006 10:44 PM by chris griffith

    Need to access secured EJB in LoginModule

    chris griffith Expert

      Dear JBossers,

      I thougth I solved a problem with my particular use case, but it has reared its ugly head again. Maybee there is someone out there who can advise.

      I need to access a secured EJB from my custom LoginModule. But just to make things a bit more tricky, I need to access the EJB during the login(), commit(), and logout() methods.

      The org.jboss.security.auth.spi.RunAsLoginModule is only designed to push run-as identity during login. I was able to use trickery and sandwich my LM between two RunAsLoginModules to get access during the commit() method. But I still have not figured out how to do this during logout().

      From what I can tell, my only option is...


      1: code my LoginModule to use org.jboss.security.jndi.JndiLoginInitialContextFactory to get EJB interface.

      2: create a sparate application-policy in login-config.xml only for this one purpose that just returns a Subject with role needed by EJB


      Anyway, just looking for other options. Anyone... Anyone... Bueller?

      thanks all, cgriffith