1 2 Previous Next 16 Replies Latest reply on Feb 21, 2003 1:54 PM by aweissman Go to original post
      • 15. Re: How can I retrieve user information upon authentication?

        Put the follow code in your server login module and ejb sessionContext.getCallerPrincipal() will return your principal

        // create a HashMap to hold the groups as they are created
        HashMap oGroups = new HashMap();

        // Set the Principal class returned from a call to getCallerPrincipal()
        Group oCallerPrincipalGroup = new SimpleGroup("CallerPrincipal");
        oCallerPrincipalGroup.addMember( oMyPrincipal );
        oGroups.put( "CallerPrincipal", oCallerPrincipalGroup );

        ... Add your roles group ...

        // create and populate the Group array
        Group[] aGroups = new Group[ oGroups.size() ];
        oGroups.values().toArray( aGroups );

        // Finally return the Groups
        return aGroups;


        HTH
        Jim

        • 16. Re: How can I retrieve user information upon authentication?
          aweissman

          thanks Jim!
          this goes in the getRoleSets() method of course, right?

          1 2 Previous Next