I think what you're seeing is the standard behavior.  Principal only
exposes a single "getName" method.
http://docs.oracle.com/javase/7/docs/api/java/security/Principal.html
You'll need to do type casting to get to your userPrincipal (cast to
GenericPrincipal
http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/realm/GenericPrincipal.html
and
then call getUserPrincipal)


On Mon, May 13, 2013 at 8:22 PM, jonnymarx <[email protected]> wrote:

> In my EJB session context, I'm trying to retrieve my custom UserPrincipal
> with JAASRealm configured.  The session context getCallerPrincipal() method
> returns:
>
> realm = TomEERealm
> TomcatUser = GenericPrincipal
>      -> userPrinicpal = MyCustomUserPrincipal
>
> userPrincipal gives me what I want, but I have no way to access it?  Any
> ideas?
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Custom-Principal-from-EJB-tp4662921.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Reply via email to