on 09-11-2005 3:42 PM
Hello all,
I have a problem getting the R3 user from the Portal user.
The portal user is: ocohen
The R3 user is 12345.
I used "user mapping" to map the "ocohen" (portal username) to the "12345" (r3 username).
I tried using this code for getting the R3 username:
IWDClientUser clientUser = WDClientUser.forceLoggedInClientUser();
com.sap.security.api.IUser sapUser = clientUser.getSAPUser();
IUserMapping userMapping = UMFactory.getUserMapping();
Map map=null;
try {
//UIDPW
//SAPLOGONTICKET
String name =userMapping.getR3UserName (sapUser,"SAPLOGONTICKET",map,true);
wdComponentAPI.getMessageManager().reportSuccess("R3 name "+name);
}
catch (UMException e) {
wdComponentAPI.getMessageManager().reportSuccess(e.toString());
}
After running the program, the variable "name" equals to "ocohen" instead of "12345"
Thanks, Omri
Hello Omri,
from https://media.sdn.sap.com/javadocs/NW04/SP9/ume/com/sap/security/api/umap/IUserMapping.html#getR3Use..., java.lang.String, java.util.Map, boolean)
<i>
public java.lang.String getR3UserName(IUser pri, java.lang.String sysid, java.util.Map sysAttrBag, boolean bGenerateId) throws UMException
...
sysid - system identifier...</i>
So, you have to pass your R/3 system ID to get mapped user name. SAPLOGONTICKET is logon method of system, not a system ID.
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Omri,
I think the return value of the getR3UserName ist correct. If you use SAPLOGONTICKET for authentication this requires that username in frontend (Web Dynpro) and backend (R/3) are identical.
With the ticket the username that authenticated against the frontend system and a certificate are transmitted to the backend system, but no password.
The backend system trusts the frontend system and tries to login the transmitted user id without checking the password, because this has already been done by the frontend system.
If usernames are different you have to use a R/3 reference system. But in this reference system the username must again be the same as in the frontend as far as I know.
So, whatever you do you will get "ocohen" back as long as you work with SAPLOGONTICKET.
Regards
Helmut
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.