cancel
Showing results for 
Search instead for 
Did you mean: 

How to validate portal user password from webdynpro application?

Former Member
0 Kudos

Hi Gurus,

i have a webdynpro application where in the webdynpro view the user enters the portal logon and password in the input field and after submittng the data ,i have to validate the password entered is right against the portal logon.How to do it ?Do we have any method to check the password entered against portal.

Thanks.

Aravind

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I don't know if there is a way to check the password like you specify, but you can force the user to login through the standard portal security (even if running the Web Dynpro outside of the EP) before they run your application. This way if they have the wrong password, they can't get in at all.

Putting this code in your wdDoInit() will display a portal login screen anytme someone accesses your application, unless they are already logged in:

IWDClientUser user1 = WDClientUser.forceLoggedInClientUser();

Hope I understood your question correctly.

Former Member
0 Kudos

Hi Tom,

Thanks for your inputs .This would not help my scenario,as i need to take the user password input from within my webdynpro application ie, after i run the webdynpro application and then user enters a password in the input field and have to validate against portal for the password entered.This is similar to the inital portal login but from the running webdynpro application

Former Member
0 Kudos

Hi,

Try this:

IUserAccount usrAccount = UMFactory.getUserAccountFactory().getUserAccountByLogonId("<logonID>",null);

if(usrAccount != null && !usrAccount.isPasswordDisabled()){
   if(usrAccount.checkPassword("<input string>"))
      //match
   else
     //wrong password
}

You will need to have a DC dependency on tc/security/api for this to work.

Regards,

Satyajit.

Former Member
0 Kudos

Thanks Satyajit,It worked...

Answers (1)

Answers (1)

Former Member
0 Kudos
IWDClientUser user=null;
	try
	{
		user = WDClientUser.getCurrentUser();
	}
	catch(Exception e){ }
	IUser name = user.getSAPUser();
	String User_Id 	= name.getUniqueName();
	String Mail_Id	=name.getEmail();
                

Simillarly you try to get password and then, validate.To use this code you need to include this library to your project,

com.sap.security.api.jar

Edited by: Rajesh A on Mar 25, 2008 1:24 PM