cancel
Showing results for 
Search instead for 
Did you mean: 

WDClientUser.getCurrentUser() doesn't return getClientUserID()

achim_hauck2
Active Contributor
0 Kudos

Hi,

i'm trying to get the User-ID of the current user in a webdynpro application. There's no Portal or any other security API installed.

the WD-application is marked for authorization and the user has to log-on, when starting the application.

The Problem is, the following code just returns a number instead of the user-id, which I would expect:


IWDClientUser user = WDClientUser.getCurrentUser();
String userID = user.getClientUserID()

other getter-methods work as expected (getLasName(), ...)

it's the same problem with forceLoggedInClientUser() .

kr, achim

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

the only way to get the login name of the user is via IUser. Since the IWDClientUser can represent a named/authenticated user, but also an unnamed anonymous user (for which the UME IUser is null), the IWDClientUser wrapper has its own identifier. This identifier is used internally to handle the existing ClientUsers.

So, the recommended way to get the login name is

WDClientUser.getCurrentUser().getSAPUser().getUniqueName().

Best regards,

Timo

Former Member
0 Kudos

Hi,

When I try this code:

IUser user = WDClientUser.getCurrentUser().getSAPUser();

This returns a null value for user. Any ideas?

Thanks,

Andrew

achim_hauck2
Active Contributor
0 Kudos

hi andrew,

as timo mentioned one post abobe: if you haven't authenticated, you'll receive "null".

turn on the authentication in your application properties, if not done yet.

kr, achim

Former Member
0 Kudos

I have same problem and when I turn on authentication in the Applications propreties, I get a second login screen displayed in the portal main frame (Please not I'm logged in into the portal already!). If I try to login with my portal credentials nothing happens, the login screen does NOT disappear. Wrong credentials give a login error as expected.

Portal and J2EE engine are on the same machine, is there anything in the portal configuration to be done?

By the way I see this misbehavior in other areas of the J2EE engine and portal as well. For example when i go to the J2EE engine start page and try to get into User Management, I also get a login screen, that does not disappear.

What is the missing link here?

Frank

Former Member
0 Kudos

How do you turn on authentication in the Applications propreties?

Joseph

Answers (4)

Answers (4)

Former Member
0 Kudos

hi Joseph,

I know that.. :).. No problem.. Thanks for the concern !

Good day !

Regards

Bharathwaj

Former Member
0 Kudos

hi Joseph,

Double click on the applcation and then go the application properties select new -> pre-defined value

-> authentication -> set its value to true.

regards

Bharathwaj

Former Member
0 Kudos

thank you Bharathwaj.

(I can't reward you, it's not my post...sorrrryyyy).

Former Member
0 Kudos

..what about?


		IWDClientUser clnt =	WDClientUser.getCurrentUser();
		String uniqName = clnt.getSAPUser().getUniqueName();

achim_hauck2
Active Contributor
0 Kudos

thanks,

with the IUser, i'm able to get the correct userID, but that i'd already expect without the IUser-Workaround.

Is this a bug in getUserClientID() in WD-standard classes?

kr, achim

sid-desh
Advisor
Advisor
0 Kudos

Hi Achim,

In order to get the User if to the logged on user use the following piece of code.

IWDClientUser user = WDClientUser.getCurrentUser();

IUserAccount[] acct = user.getSAPUser().getUserAccounts();

String userUID = acct[0].getLogonUid();

Regards

Sidharth