1

I am not a PEGA developer. But this question is for any PEGA developer/admin. This is about an issue which I noticed recently while trying to integrate my application (using REST service) with PEGA 7.

I created a REST service from my application and hosted it with OAuth 2.0 authentication. PEGA application has to consume my service.

To test the connectivity from PEGA to my application, I'd created an OAuth token myself and shared the same with PEGA developers asking them to call my service directly by skipping the authorization calls.

Using any REST testing tool such as Chrome's REST console, APIgee, etc., I was able to test my REST service by just passing the http-header param as [param name: Authorization & param value: OAuth ].

But PEGA had an issue in directly supplying the http-header parameter to test my service from PEGA PRPC application.

My Questions for PEGA developers/Admins are,

  • is it difficult from PEGA to add a header param in http calls
  • On request, PEGA screen was shared with me while a developer attempted to test my service from PEGA. During which I noticed that PEGA did not have any trace logs to capture the exact http request that was generated. Is it true that we could not see the http request (header/body) that was generated from the REST connector tool?
AMP
  • 11
  • 1
  • 4

2 Answers2

0

Adding a header parameter is relatively simple. To get information from a REST API in PEGA you define a Connect-REST rule. Sadly, I don't have enough reputation to post images in my answer but I uploaded a shot of the headers area to imgur which you can see here https://i.stack.imgur.com/c1ach.jpg. Make sure you tell your PEGA developers choose "Constant" as Map From and put the token in quotes in the "Map From Key" field like I did in the image.

Unfortunately, it is not possible to log the complete outgoing packet. If you set the logging level to DEBUG for the activity Rule-Connect-REST.pyInvokeRESTConnector it log a lot more information during the connection process, including the complete outgoing URL, but not the headers. For your PEGA developers, to change the logging level of this activity go to the Main Menu (click on DesignerStudio) -> System -> Tools -> Logs -> Logging Level Settings. There set the logger name to "Rule_Obj_Activity.pyInvokeRESTConnector.Rule_Connect_REST.Action" and the level to DEBUG.

If that's not enough to solve the problem your PEGA developers do have the option of adding in their own logging. Connector rules in PEGA are invoked rather than assembled, the code that creates the packet and makes the call to the remote service is in step 5 of that activity, pyInvokeRESTConnector. That activity can be private checked-out like any other so you could add in your own custom logging to make sure everything is being set up correctly there. However I would strongly advise them against overriding that activity in an application ruleset. Private checkouts are temporary so they are fine but an override is permanent and will also override all future updates if they decide to upgrade to another version of PRPC.

  • Hi Mike, Thanks for your input. I believe my PEGA developer did add the header param as you illustrated, but PEGA received a "401 - unauthorized" response from my application. This means, they were able to hit my server, but not authenticate themselves. This is why I wanted to know how their request packet is being framed. Let me share the same to my PEGA developer. – AMP Jul 01 '14 at 02:37
  • Yea sorry I can't help more, that's really the extent of my tricks from within PEGA. I'm not sure how much control you have over the systems but you could have the PEGA developer temporarily change the endpoint to somewhere you have control over so you can examine the contents of the incoming packet. – mdegat01 Jul 02 '14 at 03:32
0

You could use the Tool Fiddler to see what exactly goes out of Pega to invoke your service.

For OAuth Authentication , make sure the Pega Authentication Profile is set to OAuth and the token is extracted properly.

Fiddler will help you see whats going on.

PIYUSH
  • 1