cancel
Showing results for 
Search instead for 
Did you mean: 

How to get windows login user name in webdynpro application

Former Member
0 Kudos

Hi,

i have tried some codes to get windows login name in webDynpro app. but it is getting portal user id.

pls. find the code below..

String userName = System.getProperty("user.name");

wdComponentAPI.getMessageManager().reportSuccess("Username -- "+userName);

output - Username -- epdadm

I need the code how to read Windows login name from webDynpro app.

thanks.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Pls. find UME Config. below..

Data Source : Back end(Database only...no LDAP Server database)

User Mapping : SAP Client

I couldn't find any user mapping for windows....

Is it possible to read Windows logged user name in webDynpro app..?

Former Member
0 Kudos

Hi,

One thing you need to under stand is Webdynpro application is running on your server if you use properties you will get the details of the user at the server not at the client.

Is it possible to read Windows logged user name in webDynpro app..?

Depends, If you have LDAP configured to use the windows domain controller as the source for the users, you will be able to get it. But still your portal should use this.

Regards

Ayyapparaj

former_member205363
Contributor
0 Kudos

Hi Muthaiah,

This code is correct and it gives Windows user id only, because we are using the same code....

String user = System.getProperty("user.name");

wdComponentAPI.getMessageManager().reportSuccess("Window's Username: "+user);

Regards,

Lakshmi Prasad.

former_member182374
Active Contributor
0 Kudos

Hi,

Your code will probably not work because it's running on the server and not on the client.

What you can do:

Add attribute mapping to your UME so the Windows' user name will be available as UME property (assuming that the Windows' user id exists as property in your UME data source).

Read this guide: (pages 20-23)

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3641e490-0201-0010-c68f-e5122192...

You will be able to get the property by: user.getAttribute("<namespace>","<property name>")

Omri