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 BEA/Weblogic and the fly likes retieving the logged on user's password in weblogic10 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 » Products » BEA/Weblogic
Bookmark "retieving the logged on user Watch "retieving the logged on user New topic
Author

retieving the logged on user's password in weblogic10

Rajesh Unnithan
Greenhorn

Joined: Feb 20, 2009
Posts: 22
Hi,

I have an application deployed in weblogic 10. I am using a ReadOnly SQL authenticator to authenticate the user against a database. All these process successfully completed. Now In my application I would like to get the logged in users credentials such as user name and password. I am able to retrieve the username using the web logic’s subjectUtil’s class. But I am not able to retrieve the password information. I tried it by calling the getprivateCredential() method of subject class. But its returning null. The following line of code explains what I did so far

//Retrieving the subject
Subject sub = weblogic.security.Security.getCurrentSubject();
//getting the principal from subject
Principal p1=weblogic.security.SubjectUtils.getUserPrincipal(sub)
//retrieving the user name from subject – Working fine
weblogic.security.SubjectUtils.getUsername(sub)

//getting the private credentials – Not working set is always returning null
Set privateCre = sub.getPrivateCredentials();
Iterator it1 = privateCre.iterator();
System.out.println("SIZEE-@@@@@@@@@@@@@@"+privateCre.size());
while(it1.hasNext())
{
System.out.println("PRIVATE ******!!!"+it1.next().toString());
}



Can anyone help me how to retrieve the password info?


Appreciate your help

Regards
Harikrishnan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: retieving the logged on user's password in weblogic10
 
Similar Threads
InheritableThreadLocal behaviour
Authentication and Authorization Problems with IIS 6 and Jrun 4
Is this possible with JAAS, or WebSphere even for that matter?
EJB Security: Not getting correct name in Principal
Problem with JAAS(WebApp) and EJB3.0 and Jboss 5.1.0.GA