web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unable to send x-csrf-...
Power Automate
Unanswered

Unable to send x-csrf-token in HTTP POST request and Custom Connector

(0) ShareShare
ReportReport
Posted on by 337

Hi All, 

 

I have created the custom connector to call SAP Odata service to create order in SAP, however I am getting "CSRF token validation failed" error. also created Policies to solve this issue, and I tried HTTP connector POST request. but no luck.

 

I could fetch CSRF token and Cookies (I replaced ',' to ';') from previous GET request and trying to pass it to subsequent POST request. Though I could see it as input, but API returns with a message 403 and CSRF token validation failed. The same works with POSTMAN.

I connected with MS team, but the team is saying this is an unsupported scenario.

Any suggestions. ( I am trying to connect to SAP on-premise).

Categories:
I have the same question (0)
  • Perneel Profile Picture
    6 on at

    Exact same issue here, did you ever got it working? Or what work-around did you implement to tackle this?

  • MarMos Profile Picture
    16 on at
    For me the solution was to create a policy within the custom connector to "inject" the cookie into the header
     
    Within the Custom Connector "Actiotions" I defined an action to get the "x-csrf-token" and "Set-Cookie" values from SAP by a simple "GET" posting.
     
    In the "Post" action I defined the needed parameters for the Headers and Body:
     
    Within the Power Automate flow I then handover these values to the "POST" action - do not forget to replace "," (comma) by ";" (semicolon) before handing over the cookie value:
     
    Source for my solution was the great article from Doug Elliott on GitHub: https://github.com/microsoft/PowerPlatformConnectors/tree/master/custom-connectors/SAP-ODATA-Demo

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 506 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 425 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard