on 02-19-2004 12:58 AM
Hi,
I would like to know how in a webdynpro application, one can obtain the user id of the EP6 user who is logged in.
Here's one of the examples from the documentation:
// get the com.sap.security.api.IUser;
//it is null in case user represents an anonymous user
IWDClientUser user = WDClientUser.getCurrentUser();
IUser iUser = user.getSAPUser();
But the above example doesn't seem to explain, how to get the "com.sap.security.api.IUser" package.
Can somebody explain? or is there any other method of retrieving the user info?
Hello,
I am also looking for same information and i am new to this environment. My task is to design a Login page from java webapplication i.e a jsp. My problem is that how do i retrieve user iinfo so that i can verify userid & password and authenticate him/her.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry Karin for the late reply!
The issue is now solved by converting the proj into a dev component.
Thanks
-Shakeel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jessie,
Try converting your project into a development component and make sure you add com.sap.security.api.sda into your used DCs. If you are running WAS 630 SP2 or a higher version, then you will not face this problem.
To retrieve the current user id, use the following code:
IWDClientUser user = WDClientUser.getCurrentUser();
IUserAccount[] accounts = user.getSAPUser().getUserAccounts();
String userId = (String) accounts[0].getLogonUid();
The String object userId will have the value that you are looking for.
Regards
Shakeel
I can not found method getSAPUser in interface IWDClientUser in WAS 6.3 SP5 any more. Is it deleted from that version?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shakeel,
Did you organize the imports? Within source code (implementation tab) right mouse click, organize imports.
All necessary API should be imported then.
HTH,
Karin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Shakeel,
Sorry for the delay again, I had some days off
I am not quite sure, why you get this exception again and again. I would like to send you some more background information. Could you please send me an email to karin.schattka@sap.com, I will send you some stuff then. Please expect some days of delay, since I will be back in the office beginning of next week.
Best regards,
Karin
The way I usually find the path to packages is I run search in Windows in the J2EE system directory. In this case i'd search for "com.sap.security.api".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shakeel ur Rahman,
I did not really get your question, but I hope the example I found for you will help:
// Example:
// get the currently logged in user
IWDClientUser user = WDClientUser.getCurrentUser();
// check whether the current user is authenticated or anonymous
if ( user.isAnonymous() ) {
// anonymous user
} else {
// authenticated user
}
// read some user profile information
String name = user.getLastName();
String title = user.getTitle();
// get the com.sap.security.api.IUser; it is null in case user
// represents an anonymous user
IUser iUser = user.getSAPUser();
To enable authentication for a Web Dynpro application, the application property sap.authentication has to be set to true.
Hope that helps. If it does not answer your question, please let me know!!
Best regards, Karin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.