Skip to Content

about request, response and X-CSRF token

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2015 at 06:16 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 23, 2015 at 06:11 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.