-
1. Re: Custom Princpal Class
starksm64 Jun 15, 2004 10:24 AM (in response to rimmeraj)3.2.4+ supports this.
-
2. Re: Custom Princpal Class
rimmeraj Jun 16, 2004 9:50 AM (in response to rimmeraj)Excellent! So does JAAS now keep the Principal class the the server login module returns or do I have to ytell JASS which Principal class to use?
-
3. Re: Custom Princpal Class
rimmeraj Jun 17, 2004 10:45 AM (in response to rimmeraj)OK. I have looked at AbstractServerLoginModule whcih my custom Server Login Module. Now instead of useing the property I am overiding createIdentity with my own custom implementation. the problem is that it is never getting called. Therefore ctx.getCallerPrincipal is still returning a class of SimplePrincipal.
-
4. Re: Custom Princpal Class
rimmeraj Jun 18, 2004 9:11 PM (in response to rimmeraj)OK, after reading the updated javaworld anser I found my answer. I'll put it here for others.
In your getRoleSets() method you need to add another group called CallerPrincipal. The member of this class should be what you want returned when you call EJBContext.getCallerPrincipal
so a sample code snippit ...
protected Group[] getRoleSets()
throws LoginException
{
Group[] roleSets = new Group[2];
roleSets[0] = new SimpleGroup("Roles");
roleSets[1] = new SimpleGroup("CallerPrincipal");
roleSets[0].addMember(new SimplePrincipal("user"));
roleSets[1].addMember(identity);
return roleSets;
}
Where identity is a class that you want returned that implements Principal...