cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
abecerra
Level: Powered On

Custom Connector - 403 CSRF token error while action POST

Hi Guys

 

We created a custom connector that communicates with SAP. SAP is on prem so this connector uses a gateway and has basic authentication set up. Now, we were able to retrieve data from the server but we are having difficulty posting given that the CSRF token validation is activated. SAP requires a token and a cookie to validate the request. Now, to make life a bit easier we created a a flow where we trigger a request GET to the service to have the cookie and token necessary so we proceed to POST.

 

When we try this in any REST client we don't get token error 403 (so the cookie and token are valid). But if we use the connector if fails. In the POST header request for this action we set Cookie and x-csrf-token with the correspondent values.

 

ModPost.jpg

 

post save1.jpg

 

Any help or guidance on how to solve this will be appreciated. Thanks!

4 REPLIES 4
Community Support Team
Community Support Team

Re: Custom Connector - 403 CSRF token error while action POST

Hi @abecerra, The HTTP 403 error is a Forbidden error, please check if you have typed proper token and a cookie within the Header part of the specific operation of your custom connector. Based on the screenshot that you provided, I think you have provided your token and cookie value within the Request Body part of the specific operation of your custom connector, is it true? Please consider take a try to put the token and cookie parameter value within the Headers part of the specific operation (PostMaterialCount) of your custom connector, then try your custom connector again, check if the issue is solved. Best regards, Kris
Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
abecerra
Level: Powered On

Re: Custom Connector - 403 CSRF token error while action POST

Hi

Those are header parameters. 

 

postSampleHeader.png

sshah2001
Level: Powered On

Re: Custom Connector - 403 CSRF token error while action POST

Was this ever resolved? I am having same issue.
abecerra
Level: Powered On

Re: Custom Connector - 403 CSRF token error while action POST

Hi

No, and it won't be solved at the moment given that the connectors do not pass cookies. SAP requires a token, and a cookie for authentication.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 158 members 4,090 guests
Please welcome our newest community members: