• Post Reply Bookmark Topic Watch Topic
  • New Topic

retieving the logged on user's password in weblogic10  RSS feed

Rajesh Unnithan
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

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

Can anyone help me how to retrieve the password info?

Appreciate your help

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!