Thursday 13 February 2020

POSTMAN- CSRF token validation failed error - Fix

If you encounter an issue in the POSTMAN when calling the POST method even though you are passed in the valid X-CSRF token by using the GET call in the previous step. Then here is the solution for your problem.

While sending the POST method, use the extra header parameters to solve this.

"CSRF token" and  "cookie" header should be picked from the GET call.

X-CSRF-Token:pIgKS5dokT0FZTouD8-jig==
Content-Type:application/json
Connection:keep-alive
Cookie:SAP_SESSIONID_KUH_246=fgAZqA33-I3QLvTa5yuXPb-AoFlObxHqhCcAFj5r60I%3d


Hope this resolves your issue. If yes, comment below. Thanks



2 comments:

  1. Dear Raju,

    Thank you for your blogs.
    Now, I facing the problem that I have main integration process, local integration process and exception subprocess for local integration process.

    1. Integration Process
    => 1.1 Content Modifier (Exchange Property -> Name : error_info , Type : Constant , Value : Test)
    => 1.2 HTTP Receiver Adapter (Get the xml data format)
    => 1.3 Process Call (Go to local integration process)
    => 1.4 Content Modifier (Message Body -> Type : Expression , Body : ${property.error_info})
    => 1.5 Groovy Script (for body)
    2. Integration Process
    => In this step, create the data to HANA DB using OData.If error has occured in this step, go to exception subprocess.
    3. Exception Subprocess
    => In this step, I would like to change the data for error_info.So, I used the groovy script and set the data to error_info(message.setProperty("error_info", "Test error")).But, it's not effected to error_info.

    ※message.setProperty("???") can be effected in one process.
    ( I means, can be set the data from main integration process.
    If I declare in local integration process, it's set from this.)

    So, how to set the data from exception process of local integration process to main integration process?
    Could you please advice for my issues.

    Thanks and Best Regards,
    Tun

    ReplyDelete
  2. Sorry for delay, try declaring the variable as global variable or try to make the write variable and do a rewriting at exception process to change it. Still not clear, please let me know.

    ReplyDelete