on 06-09-2005 7:25 AM
Hi,
I develop a WebDynpro Application for SAP Portal 6.0 SP9. I want to read the user ID of the currently logged in Portal User in my WebDynpro Application to show personalized data. In the WebDynpro I use the following code:
if (WDPortalUtils.isRunningInPortal()) {
logger.debugT("WD in Portal!");
try {
IWDClientUser curUser = WDClientUser.getCurrentUser();
IUser sapUser = curUser.getSAPUser();
String userId = curUser.getClientUserID();
if (sapUser != null) {
userId = sapUser.getUniqueName();
}
... catch etc.
}
The IUser sapUser is always Null, the userId is set to a - for me useless - two digits number...
Portal and the J2EE engine are running on the same system.
So I tried to switch on authentication in the properties of the application.
The result was that I get a second login screen when I call the IView with my WebDynpro in it.
When I enter my Portal credentials, nothing happens, login screen comes again. Giving wrong credentials results in a bad login error as expected.
So can someone tell me what I miss here? Is there another way to get the User data? I tried some standard Java ways, but as always SAP does not conform to that standards.
Thanx in advance for any help,
Frank
Hi Frank
Try out the following code. It worked for me.
try
{
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();
if (user != null)
{
IUserAccount[] acct = user.getUserAccounts();
if(acct[0] != null)
{
String strUserid = acct[0].getLogonUid();
String strPasswd = acct[0].getHashedPassword();
}
}
}
catch etc
Hope this helps you
Regards
Rajeev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
I am facing the same problem in getting the information of the logged in ep user in my webdynpro application with the same code.
Could u tell me how can i change the JAAS configuration.
thanx and regards,
anuradha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anuradha
Please check out this link. It might prove useful.
http://help.sap.com/saphelp_nw04/helpdata/en/b9/9482887ddb3e47bd1a738c3e900195/frameset.htm
Warm Regards
Priya
Hi Frank
Try out the following code. It worked for me.
try
{
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();
if (user != null)
{
IUserAccount[] acct = user.getUserAccounts();
if(acct[0] != null)
{
String strUserid = acct[0].getLogonUid();
String strPasswd = acct[0].getHashedPassword();
}
}
}
catch etc
Hope this helps you
Regards
Rajeev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.