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

Announcements

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard