cancel
Showing results for 
Search instead for 
Did you mean: 

Reading User Logon and Password on Web Dynpro Application

Former Member
0 Kudos

Hi All,

Can some tell me how to read the Logged in user name and his/her password in a webdynpro application.

Thanks in advance

Srikant

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Adding to the Kasig,

You need to use the

<i><b>WDClientUser.getCurrentUser().getSAPUser()</b></i>

for getting the user.

As said by Kasig, you need to make sure that SAP Authentication is enabled in the Application Properties.

Thanks & Regards,

Raghavendra P

Former Member
0 Kudos

Hi

Sorry for getting back to you people bit late.

I've tried the thing and its working

But i too need to the information regarding his password.

In my application, username and password has to be filled in again which needs to be checked. so how do you do that.

one more query whether any input field can be masked in webdynpro application??

Thanks in advance

Srikant

Former Member
0 Kudos

Hi Srikant,

For getting the Password, We cant get the password of the user. I think it can be done using the UserMapping. check it out.

If you are looking this for calling the SAP ABAP function modules using the logged in user id and password then you can use the SAP Logon Tickets configuration.

By doing this, Portal it self read the current user id and takes his password and uses it to call the SAP Function Modules.

Try this if your scenario matches.

And when it comes to InputField's Mask.. we dont have such option. There is PasswordField property where you can make it true, maybe it can useful for you.

Thanks,

Raghavendra P

former_member182372
Active Contributor
0 Kudos

Hello D.V.Srikant,

You know already how to get IUser, so rest is below:


IUserAccount[] com.sap.security.api.IUser.getUserAccounts();
com.sap.security.api.IUserAccount.checkPassword(java.lang.String pass) or getHashedPassword()

Best regards, Maksim rashchynski.

Former Member
0 Kudos

D.V.,

<i>one more query whether any input field can be masked in webdynpro application??</i>

set "passwordField" to true on IWDInputField

VS

Former Member
0 Kudos

D.V.,

Neither security framework lets you access password in plain form. If it does -- then never use it

I guess the best option for you here is to setup Single Sign-On (SSO) between systems used. User mapping (as someone suggesting) may works as well for ceratin scenarios.

VS

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

edit the application properties, set sap.authentication true

you need the following import:

import com.sap.security.api.IUser;

which you find under eclipse plugins.

then the following coding brings across the logged on user:


String logonID = "";

		try
		{

			IWDClientUser wdUser = null;
			try
			{
				wdUser = WDClientUser.getCurrentUser();
			}
			catch (WDUMException e1)
			{
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}

			// hängt an security.api.jar
			IUser user = wdUser.getSAPUser();
			logonID = user.getUniqueName();

		}
		catch (Exception e)
		{
			msgMgr.reportException("Error: " + e.getMessage(), true);
			e.printStackTrace();
		}

hope this helps, matthias

Message was edited by: matthias kasig

Former Member
0 Kudos

Hi matthias

I am not able to improt the packege com.sap.security.api.IUser how to add that plug in

Thanks

Ninad