cancel
Showing results for 
Search instead for 
Did you mean: 

Build Process Automation: Obtain OAuth 2 token on call of an action

0 Kudos
737

Hi experts,

I have configured an action in BPA that calls a CAP service. This CAP service makes two PATCH calls to update some fields of the API_BUISNESS_PARTNER, one call updates fields of A_BusinessPartner and the other of A_Customer.

From the Test of the same Action it works fine:

From the test.http file of the CAP project as well:

From Postman it works fine as long as the authentication is OAuth 2.0.

If I run the BPA process but, it fails with the following message:

Action '13832448-28a1-4ccf-b496-097e0696b794' failed with the following error: 'Error thrown from action runtime library: Failed to execute action Set Client Status: Failed to build headers. The destination tried to provide authorization tokens but failed in all cases. This is most likely due to misconfiguration. Original error messages: Retrieval of OAuthToken failed due to: unexpected error'.

I think it is a problem with the CSRF of the action, which must be configured correctly and I don't know how:

Screenshot of the destination:

I have followed the following tutorial: CAP simple nodejs service In this case, the tutorial indicates that you have to create a destination with authentication type NoAuthentication, but the result is the same, I have already tested it. For the CSRF configuration I have followed these documents: SAP Build Pprocess Automation - csrf-token SAP Build

and Process Automation - Using x-csrf-token in actions

When configuring the Action in this way, the error I get in the process is as follows: Action ID: post_setStatus Destination: BPA_To_CAP Error message: Action 'b92aeacd-eeb0-47bd-9f62' failed with the following error: 'Error thrown from action runtime library: Failed to execute action Set Client Status: Failed to build headers. The destination tried to provide authorization tokens but failed in all cases. This is most likely due to misconfiguration. Original error messages: Retrieval of OAuthToken failed due to: Unable to fetch refresh token from the specified token service URL. Response was: Token header claim [kid] references unknown signing key : [default-jwt-key--1272797071]'. I have also tried this:

Configuring x-csrf using actions editor

Any help would be welcome.

Thanks and Best Regards,


Dídac.


PD: I've opend a note to SAP but without much success...

masoomjajoo9229
Explorer
0 Kudos
May I know if you have got it resolved. I am facing similar issue.
Naveen_raj
Newcomer
0 Kudos
Hi...Any solution ? I am also facing same issue

Accepted Solutions (0)

Answers (1)

Answers (1)

WouterLemaire
Active Contributor
0 Kudos

We added the following property to the destination and this works:

- sap.build.usage: CAP

WouterLemaire_0-1726429662635.png