cancel
Showing results for 
Search instead for 
Did you mean: 

Read user-id / sap-name

thomas_rodemer
Employee
Employee
0 Kudos

Hello,

i have an Java WebDynpro Application and want to read the user-id / sap-name of the user visiting the Java WD site. The Java WD application is public and on an application server where the visitor has no user in the system! I want to read the user-id, which the user has on the portal (another application server), or for example from the single sign on SSO.

Is there any possibility to read the user-id from SSO or via a cookie or something else? I just need the user-id or the sap-name. No password and no authorization needed!

Kind Regards,

Thomas

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Thomas,

Did you try:

IWDClientUser clientUser = WDClientUser.getLoggedInClientUser();

IUser user = clientUser.getSAPUser();

Hope this helps.

Eneko.

thomas_rodemer
Employee
Employee
0 Kudos

Hello,

thank you for your answer.

Yes i tried it, but the problem is that the user is not logged on in the application server where my Java WD application runs. I need the user-id from the SSO or a Cookie or something else.

Regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

With SSO, the user gets to keep a cookie with name MYSAPSSO2, and I'm sure this has the user-id. So, may be you should try retrieving this cookie.

Regards,

Rajit

thomas_rodemer
Employee
Employee
0 Kudos

Hi,

thank you for your help!

The idea sounds very good. Is there any sample source availiable? I searched the forum but only find samples for abap.

Kind Regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

I've checked the cookie MYSAPSSO2 and found it to be an encrypted value. But, I think i've found another way to get the user-id. Please try this and let me know.

IWDClientUser clientUser = WDClientUser.forceLoggedInClientUser(TaskBinder.getCurrentTask().getProtocolAdapter().getRequestObjectInternal().getProtocolRequest(), TaskBinder.getCurrentTask().getProtocolAdapter().getResponseObjectInternal().getProtocolResponse());

String userId = clientUser.getClientUserID();

Also, set the application property "authentication" to true (if applicable).

Please let me know.

Regards,

Rajit

Former Member
0 Kudos

Hi Thomas,

If my previous post doesnt help you, there's one more you can try. Its SAPSSOEXT. For one, it can be used to verify the cookie as well as decrypt it to get the userID (as I understand).

Get it from:

https://service.sap.com/swdc

Downloads -> Search Support Packages and Patches (search for SAPSSOEXT). I'm trying to download it as we speak and will let you know if I find anything.

Also, check this thread.

Regards,

Rajit

UPDATE:

I've tried with SAPSSOEXT and was able to get the user-id from SSO cookie.

Get SAPSSOEXT and SECULIB54 (this has sapsecu.dll) from Service Market place.

Place both dlls in PATH.

Get the verify.pse certificate file from the portal server issuing SSO ticket and run the sample Java class file from SAPSSOEXT.

Let me know if you've trouble.

Regards,

Message was edited by:

Rajit Srinivas