on ‎2023 Nov 01 6:26 AM
I'm currently facing an issue with CSRF-Token validation while attempting POST/PUT operations in my SAP Build application. The application runs smoothly on the local environment, and I've successfully tested it under the Data tab using the update method. However, when I build the application as MTAR and deploy it to the BTP CF, the POST/PUT operations encounter CSRF-Token validation failures.
I've configured the SAP Cloud Connector and destination on BTP, and the integration in the Data tab of the SAP Build application seems to be working without any hitches. The issue only arises after deployment to BTP CF.
I would greatly appreciate your insights or any guidance you could provide to help resolve this CSRF-Token validation issue.
Thank you in advance for your time and assistance.
Best Regard's
Manish Kumar

SAP Build Data Tab

Post Operation Locally

Post Operation from BTP deployed application

Request clarification before answering.
Hello @Venkat_Vyza
I have changed parameter value also but still facing the same issue. Any other thing I can check?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manish,
I'm facing the exact same problem. By debugging /IWFND/CL_SODATA_HTTP_HANDLER I can see that, in preview mode, there's an HTTP HEAD request (CSRF token gets fetched) followed by the actual POST whereas in the deployed BTP application, there is only the POST.
Did you find any solution for this?
Thanks!
Gonçalo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, did you already try to provide
BuildApps.RequiresCsrf = true
In btp destination additional properties?
https://help.sap.com/docs/build-apps/service-guide/sap-systems
In preview there is a proxy in between that handles the token, but in standalone apps that is not present.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Pekka,
As per your guidance, I have incorporated the additional property in the BTP Destination configuration to address the X-Csrf-Token validation issue. Unfortunately, despite these efforts, the problem persists, and I am still encountering the X-Csrf-Token validation failure.
I have double-checked the configuration, and I can confirm that the additional property has been successfully added. However, the expected resolution has not been achieved. I would greatly appreciate any further insights or recommendations you may have to help us overcome this challenge.

| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.