This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Security and the fly likes request.getUserPrincipal() return null after authentication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "request.getUserPrincipal() return null after authentication" Watch "request.getUserPrincipal() return null after authentication" New topic
Author

request.getUserPrincipal() return null after authentication

Vaibhav Tomorrow
Greenhorn

Joined: Jun 30, 2008
Posts: 6
Hello ,
How can I associate a subject with Websphere Context.
I am not able to get the user Principal after authentication.
For authentication I have created a subject :
HashSet principals = new HashSet();
HashSet privateCredentials = new HashSet();
HashSet publicCredentials = new HashSet();
principals.add(new UserPrincipal("Vaibhav"));
publicCredentials.add("xyz123");
privateCredentials.add("xyz123");
Subject subject = new Subject(false, principals,publicCredentials, privateCredentials);

LoginContext loginContext = new LoginContext("Userpass",subject);
Using this I am able to perform authentication , but when I tried to get the user Principal in jsp it always return null.
can any body help me what do I need to do to get the user principal.
[ July 05, 2008: Message edited by: Vaibhav Vaibhav ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: request.getUserPrincipal() return null after authentication
 
Similar Threads
InheritableThreadLocal behaviour
Authorization using JAAS
Very frustrated with no idea how to check logins
Can't get my custom principal using getCallerPrincipal
JAAS login servlet