on 06-22-2010 5:09 AM
Hi All,
I am facing a problem while getting the user id of the logged user in my application. I have written the following code to get the id of the logged user:
IWDClientUser wdClientUSer = WDClientUser.getCurrentUser();
StringTokenizer stkUserName = new StringTokenizer(wdClientUSer.getClientUserID(),":");
while (stkUserName.hasMoreElements())
{
String strUserID = stkUserName.nextToken();
}
this returns the output as USER.PRIVATE_DATASOURCE.un:<user_id>. Using the string tokenizer, i am able to get the <user_id> and displaying it on the screen.
This works fine on the Dev and Quality server, but when the same code is deployed on the production server, the user id is retrieved as USER.CORP_LDAP.<user_id>.
Please let me know how can this be corrected to get the <user_id> alone?
Regards,
Poojith MV
Solved. Added the com.sap.security.sda to the dependency of the DC
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry. Accidentally clicked on Answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Poojith,
You can directly get the user id of the logged user by below code.
Sting userId = WDClientUser.getCurrentUser().getSAPUser().getUniqueName();
Regards
Ravindra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravindra,
Thanks for the reply. But I found one thing which i don't know if that is how it works. I tried using the statement:
IUser user = WDClientUser.getCurrentUser().getSAPUser();
but the IUser was throwing an error that there was no such API. I Tried doing Organize Imports, but did not work. I checked in the installation directory of my NWDS to see if there was an API for com.sap.security. It was present but the import was not happening.
Later i right-clicked the project and in the Java Build Path>Libraries>Add External Jars, I added the 2 Jars present in the folder of my NWDS installation and then it started working.
Is this how it should be done or is there a better way to do it.
Regards,
Poojith MV
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.