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 POST request

(2) ShareShare
ReportReport
Posted on by

Hi Experts, 

 

I am trying to send POST request using HTTP connector. The Odata API required x-csrf-token to be sent as well. I could fetch token from previous GET request and trying to pass it to subsequent POST request. Though I could see it as input, API returns with a message 403 and CSRF token validation failed. The same works with POSTMAN. Please suggest.

Input :

pipa_0-1645209331757.png

 

Raw input :

pipa_3-1645209491550.png

 

Output

pipa_2-1645209382676.png

 

Regards,

 

Categories:
I have the same question (1)
  • japel Profile Picture
    4 on at

    Had the same issue for days and figured it out today:

     

    You need to submit the session cookie, which you will find in the "set-cookie" header of your GET request. 

    This needs to be passed to the POST request. Unfornately this can't be done using a custom connector. 

    I used a normal http request for this. You can set a Cookie Attribute there.

    For the info from "set-cookie" you need to replace "," with ";" before passing it to your POST-Request. 

  • TM82 Profile Picture
    6 on at

    can you plz elaborate and give the syntax for the post method

  • VDI Profile Picture
    337 on at

    Is it resolve? I am also getting the same error.

  • Abdollar Profile Picture
    3 on at

    Yes, it has been resolved.
    Modify this expression to yours "replace(outputs('Get_product')['headers']['Set-Cookie'],',',';')" to replace commas in your set-cookie.

  • VDI Profile Picture
    337 on at

    Thanks, I have replace the commas to semicolon, but still I am getting the CSRF token validation failed error.

    I am trying to connect to on-premise SAP System via data gateway and already did all the configuration but still unable to send cookies.

  • PowerPlatChadd Profile Picture
    13 on at

    Running into same issue, did you ever figure this out?

  • imranimzzy Profile Picture
    24 on at
    Here is the screenshot of how you pass the cookie getting from the GET x-csrf-token call. Please accept this as a solution if it resolves your query.

    1. Getting the csrf token
    2. In Compose replacing the set-cookie value ',' with ';'.
    3. POST call by sending the Cookie value.

  • PC-28030728-0 Profile Picture
    2 on at
    Hi Guys, I'm new to power apps. I'm using custom connection to generate CSRF token. I managed to get 200 response but the x-csrf-token is not included in the Header respone. Appreciate if someone can help me. Big help!

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard