cancel
Showing results for 
Search instead for 
Did you mean: 

X-CSRF Token in CRUD Fiori

Abhinav_Sharma
Contributor
0 Kudos

Hi Gurus,

I am trying to develop a CRUD application using SAP Fiori CRUD template in WebIDE. I am getting the X-CSRF token error and I know I have to pass the token along with the ODATA request.

However, I am not able to locate in the template where the actual ODATA specific code is written.

My questions are:

  1. Does anyone know or worked in WebIDE CRUD Fiori template and guide me to locate the ODATA specific code where the ODATA calls are triggering. I checked the Component.js , Base.controller.js and App.Controller.js but not able to find it out.
  2. Is it recommended to use these templates as I dont find it easier to maintain.
  3. Is there any place where we can read more about these templates.or anyone can point me to the related documentation.

Thanks!

Abhinav

Accepted Solutions (1)

Accepted Solutions (1)

gill367
Active Contributor
0 Kudos

I guess this documentation on the below link contains some of the details

SAPUI5 SDK - Demo Kit

Also manifest.json will be containing the required odata service details in data sources tab

The below should put some light on the app flow

SAPUI5 SDK - Demo Kit

and model instantiate process

SAPUI5 SDK - Demo Kit

Regards,

Sarbjeet Singh

Abhinav_Sharma
Contributor
0 Kudos

Thanks Sarabjeet for sharing the links.

I am aware of the documentation however, I guess CRUD operations are missing in these documentation.

I tried creating the CRUD Master Detail application using one of the templates, however, I am getting below error while testing it.

{

        "message": "HTTP request failed",

         "headers": [],

         "statusCode": 403,

         "statusText": "Forbidden",

         "responseText": "CSRF token validation failed"

}

I know we have to pass CSRF token along with the Create request, however, in this case I am not able to find out where exactly it is looking for the information or what I am missing.

Thanks!

Abhi

Answers (0)