Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

when getUserPrincipal() is null?

843841Mar 8 2006 — edited May 30 2007
Hi.
I have an ancient doubt about JAAS autentication on Web applications. By using form autentication, when navigating in a page that has some kind of role restriction, the request.getUserPrincipal() returns the correct Principal value.
But, if I navigate to a unrestricted area, the getUserPrincipal returns null. And the odd thing is, I can navigate back to the restricted area becouse without need of new login. Why?
So, my question is, How can I get the current Principal in a servlet, and how can I check if a user is in Role by just using plain JAAS/J2ee.
I use Tomcat and Tomcat+Jboss, and both give the same situation.
I'm not importing any tomcat/jboss jar.
Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 27 2007
Added on Mar 8 2006
2 comments
960 views