3.2.4+ supports this.
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?
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.
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()
Group roleSets = new Group;
roleSets = new SimpleGroup("Roles");
roleSets = new SimpleGroup("CallerPrincipal");
Where identity is a class that you want returned that implements Principal...