I have the same problem that everyone else has! I am doing things correctly in my JAAS LoginModule:
| public class GreenfieldsLoginModule extends AbstractServerLoginModule | { | | ... | | private void createRoleSets() throws LoginException | { | SimpleGroup roles = new SimpleGroup("Roles"); | | // Add roles held by the user. | // Currently, the only role is "User". | roles.addMember(new GreenfieldsUserRole("User")); | | SimpleGroup callerPrincipal = new SimpleGroup("CallerPrincipal"); | callerPrincipal.addMember(getIdentity()); | | roleSets = new SimpleGroup[]{ roles, callerPrincipal }; | } | | ... | } | It extends AbstractServerLoginModule. The createIdentity() method of that correctly creates my custom principal because I have my login-config.xml set up like this: | <!-- Greenfields JAAS login module. --> | <application-policy name="Greenfields"> | <authentication> | <login-module code="com.fcl.security.GreenfieldsLoginModule" | flag="required"> | <module-option name="unauthenticatedIdentity">anonymous</module-option> | <module-option name="principalClass">com.fcl.security.GreenfieldsUser</module-option> | <module-option name="ignorePasswordCase">true</module-option> | | </login-module> | </authentication> | </application-policy> | | In my JSP pages, request.getUserPrincipal() returns a com.fcl.security.GreenfieldsUser as I expect. In my first try, my EJB returned a org.jboss.security.SimplePrincipal from ctx.getCallerPrincipal() inside the EJB. Now I've added the following jboss.xml to my EJB JAR: | <?xml version="1.0" encoding="UTF-8"?> | <jboss> | <security-domain>java:/jaas/Greenfields</security-domain> | </jboss> And it's saying | 10:54:48,375 ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files | java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found At the point I'm invoking the EJB's method. It's not even getting into the EJB, it's trying to log in again using the properties files! This must be so common!. I want it to use the same Principal as the web application so that I can use my own custom principal which knows all about the logged in user, his preferences, and privileges! How do I do it? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3931288#3931288 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3931288 ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user