Skip to Content
0
Former Member
Dec 19, 2017 at 05:36 PM

How do I set the X-CSRF-Token correctly in an Alexa POST Request to SAP HANA? (403 error)

2020 Views Last edit Dec 19, 2017 at 07:47 PM 2 rev

Hello community,

I have a problem with the x-csrf-token validation with regard to a HTTPS-Post-Request. The request comes from a Lambda function triggered by an Amazon Alexa skill and is sent to a XSO Data file running on the SAP Cloud Platform in an SAP HANA Database. I use Javascript/Node.js.

A valid token is set in the request header (see code in the first picture below) but the response header shows for the x-csrf-token "required" (see code in the second picture below). So there is an error with the validation. The same post request with POSTMAN works correctly, but when I try it via a JS File as a Lambda function (in the first picture) there it comes this error with HTTP status code 403 (see code in the second picture below). The POST request itself does work, but the token validation not. GET requests work fine.


Does anybody know a possible solution?

Thank you very much!

Attachments