cancel
Showing results for 
Search instead for 
Did you mean: 

about request, response and X-CSRF token

0 Kudos

hello experts,

can someone explain about request, response and X-CSRF token in UI5 while connecting from eclipse to back end for create, update and delete operations.

thank you.

Accepted Solutions (1)

Accepted Solutions (1)

egenoves
Participant

Hi Phanindra,

you will need the X-CSRF-Token to send it in the headers of a POST/PUT HTTP Request.

To get it from backend, simply call a GET HTTP method with a header X-CSRF-Token:Fetch, and you will receive in the response a header which looks like x-csrf-token:ad8a7asdsn8sa==

You need to put this token in all the headers of a modifying operation, POST for an example.

It's a security mechanism from the backend. If you're not authenticated properly you won't be able to fetch the CSRF token.

Hope this helps

Answers (1)

Answers (1)

karthikarjun
Active Contributor
0 Kudos

Hi Phanindra,

Request:

1.To trigger/get information from user to database

Flow:

UserScreen ----> Gateway Service ----->ECC

  1. var oDATAServiceURL = "http://server/ias_relay_server/client/rs_client.dll/ODATAFARM/sap/opu/odata/sap/Z_OURSERVICE"
  2. var oDATAServiceUserName = "NetWeaverGatewayUserID"
  3. var oDATAServicePassword = "PasswordOfNetWeaverGatewayUserID"
  4. var myODATAModel = new sap.ui.model.odata.ODataModel(oDATAServiceURL, false, oDATAServiceUserName, oDAT)



Response:


It returns your required information under success call back function



X-CSRF:


While creating/updating the records. we want csrf-token.


How to fetch X-CSRF-Token | SCN


Thanks,

Karthik A