1 Reply Latest reply on Apr 22, 2003 1:06 PM by frobazz

    AbstractServerLoginModule how does it map roles of applicati

    Michael Schreiber Newbie

      I am interested in rolling my own implementatation of the LoginModule and handling my own roles and possibly permissions.


      I am looking at the code for AbstractServerLoginModule and need some help understanding the commit() method.

      How are the roles mapped from the deployed application to the roles of the user. I know that this class calls the concrete class DBLogin to get the roles, but I want to know where the roles are checked to see if the application role maps to the role of the user?

      If I write my own implementation of LoginModule, do I have to stick to using getRoleSets() from the concrete class???

      Any help is appreciated.

        • 1. Re: AbstractServerLoginModule how does it map roles of appli
          frobazz Newbie

          I looked at the code and wrote my own login module from scratch (this is in JBoss 3.0.3), and didn't use getRoleSets. Basically, I was required to create a NestableGroup with the name "Roles", then add to it a SimpleGroup named "Roles" as well. To the simple group I added my SimplePrincipals with the appropriate role names. Not sure why it works that way, but it seems to work fine.

          Here's an example:

          SimpleGroup sg = new SimpleGroup("Roles");
          sg.addMember(new SimplePrincipal("RoleName"));
          NestableGroup ng = new NestableGroup("Roles");
          ng.addMember(sg);

          Hope this helps.