cancel
Showing results for 
Search instead for 
Did you mean: 

PI WebService, get username

Former Member
0 Kudos

Hello, I need some advices.

The task is:provide data from backend SAP ERP via HTTP-reachable web-service on the Portal.

The problem is: web-service access must be restricted with portal user authorization. SAP ERP accessed with technical user and providing real-username as a parameter.

The question is: is it possible to provide such web-service, handled by PI? So, PI-part has to get username somehow.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I decided not to use PI. Populated data from ERP is operational, so some more simple way should be used.

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for fast advices, some more information should be provided here.

The real web-service caller is SAPUI5 form published on the portal with required authorization. Collecting username on the form before calling web-service is not an option. Custom username field could be easily compromised using browser.

So the solution must be found somewhere on the backend side, where username could be caught from authorization details.

JaySchwendemann
Active Contributor
0 Kudos

Are you really needing the portal user or would the gateway user suffice? If the latter, you should be able to get. See here https://websmp206.sap-ag.de/~sapidb/011000358700000944892012E in chapter 4.2.6.3 Accessing System and User Information.

Does that help you?

Cheers

Jens

JaySchwendemann
Active Contributor
0 Kudos

Hi Andrew,

this sound an awful lot like best being dealt with principal propagation Configuring Principal Propagation Using the Advanced Adapter Engine - SAP Process Integration - SAP ... and .

But since you didn't ask for that but want to use a technical user for access, you'll somehow need your sender (the portal where the user is logged on to) to fill in the username. Like Iñaki I would send the username in the payload.

I'm in no means a portal expert but getting the username in portal should be possible, depending of course on the kind of application that calls the web service

Cheers

Jens

former_member184720
Active Contributor
0 Kudos

Agree with Jens.

We had similar requirement and in fact that was my first portal assignment. It's just that backend was not an ECC system in mycase.

to get the currently logged in user from portal :

public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)

               {

                              HttpServletResponse resp = request.getServletResponse(true);

                              IUserContext user = request.getUser();

                              String user_id = user.getLogonUid();

And it would Soap(protal) <-> PI <-> Proxy(ECC)

From PI, you make a call to ECC using technical user.

While calling PI webservice, you can the logged in user info to proxy which should return the data for that particular user.

iaki_vila
Active Contributor
0 Kudos

Hi Andrew,

AFAIK the Receiver SOAP adapter has not a a dynamic variable to determine the user by dynamic configuration Configuring the Receiver SOAP Adapter - Advanced Adapter Engine - SAP Library, may be another SCN memeber has dealed with this.

I have a similar scenario than yours and i've controlled:  via Party, accessing the Party variable via mapping and later determinated the receiver and the different communication channel using a context object.

I think you will want to use sender abap proxy, my idea is that you can create a sender tag in the XML with the name user and to use this tag in a Context Object to determine different Receiver Business Service and consequently different communication channel with their portal users.

Regards.