tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad O'Hearne <>
Subject Tomcat user principal
Date Sun, 16 Oct 2005 03:20:13 GMT
I am using the JAASRealm for Tomcat 5.x, and in my JAAS module, I am 
storing my own Principal subclass as the user principal. In my 
subsequent servlets, when I invoke the request.getUserPrincipal() 
method, I am not returned my user principal, but I am instead returned a 

It appears that this GenericPrincipal is wrapping my user principal 
class. I have encountered two problems in particular with this:

1) Even though the getClass().getName() method on the GenericPrincipal 
returns GenericPrinple, if I try casting it to this type, I receive a 
ClassCastException, so the only type I can work with is the standard 
Principal interface.

2) There is no way to get at my user principal.

Basically what I am trying to do is populate a custom user Principal 
implementation in my JAAS module, and retrieve my custom user principal 
again from within my servlet class. Does anyone know how to do this in 



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message