cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing Portal user information in WebDynpro Application

Former Member
0 Kudos

Hi all,

I was trying to get the information of a user logged on to a portal.I used the following code.

IWDClientUser clientuser = WdClientUser.getCurrentUser();

Iuser user = clientuser.getSAPUser();

String username = user.getUniqueName();

String uniqueID = user.getUniqueId();

WDContext.currentContextElement.setUserName(username);

WDContext.currentContextElement.setUniqueId(uniqueID);

This username and UniqueID are displayed in a textview .

I created a WebDynpro iView based on this application. I created a system for the Web Application Server on which my application is deployed.Instead of "Single Sign On" I'm using User Mapping.

The problem is my application always gives

username=Administrator

uniqueID=USER.PRIVATE_DATASOURCE.un:Administrator,even if I logon to portal with a different username.

I had done usermapping using the Web application Server's administrator's userID and password.Even if I do usermapping with a different user the result is the same.

Is this the problem due to usermapping and which administrator is the application showing WAS or Portal.

Can anyone help me out?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi

I am also using the same code for same purpose.But I am not able to deploy my application. I am getting a warning as :

The referenced application ''sap.com/com.sap.portal.usermapping'' can''t be started.

Check the causing exception for details. Hint: Is the referenced application deployed correctly on the server?

Can you please help me ..

Archana

Former Member
0 Kudos

could u just help me out in LDAP connectivity

actually we have to use user-information in a web dynpro application ...

so do we have to install a portal server also to do the LDAP connectivity or can we do it directly from web dynpro

Former Member
0 Kudos

LDAP connectivity has nothing to do with web dynpro.. you have to configure that from your was settings.. not from WD.

Former Member
0 Kudos

Hi Pradeep

Is your WAS(Where Webdynpro Components are deployed) and EP are running in two different servers? If this is the case you cant get the Userid from the above code.

If you want the details of the User logged, Write a Portal service and expose the same as Webservice. Consume this webservice in Webdynpro.

Regards

NagaKishore V

Former Member
0 Kudos

Thanks for ur prompt reply.

Well I can write a portal service and use that in my web Dynpro application.

But is it not possible that I establish Single Sign On between the two servers i.e.WAS and portal server and then access the information.

Is writing the portal service the only way?

Former Member
0 Kudos

Hi Pradeep

If you can configure SSO between Webdynpro and Portal then you can get the request object. So you can go with out the Portal Service/Webservice

NagaKishore

Former Member
0 Kudos

Hi NagaKishore,

I have been trying to establish single sign on between my portal server and the Web application server.But I'm facing some problem.

My portal server is generating the ticket for the user but the Web AS is not able to receive the ticket.

Do you have any solution to this problem?

Regards

~Pradeep Shetty

Former Member
0 Kudos

Hi Pradeep

what are the steps u did to establish single sign on

Regards

Pran

Former Member
0 Kudos

hi pradeep,

the code to get the current user from portal, is like this

i suppose

IWDClientUser wdUser = WDClientUser.getCurrentUser();

IUser user = wdUser.getSAPUser();

if (user != null)

{

IUserAccount[] acct = user.getUserAccounts();

if(acct[0] != null)

{

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

}

}

now create an SAP webdynpro iview based on this project. give the system as SAP_local which is the default system for webdynpro applications.no need of creating a system explicitly or performing usermapping.

regards,

rahul.