cancel
Showing results for 
Search instead for 
Did you mean: 

S4 Hana Cloud and Integration Framework (B1if)

filipe_felisberto
Discoverer
0 Kudos
308

Hello experts,

I am trying to use B1if to comunicate with S4 Hana Cloud, I understand that I need to use the CSRF token.

So I have one initial step that makes an HTTP GET request for the token, using the header part:

<par id="httpheader.x-csrf-token" value="fetch"></par>

With this get as a response a really big cookie and the expected token.

So on next step, I have the post call where I send the token (same tag but instead of the fetch keyword). In debug mod I can see that the token is being passed but I still get:

<exceptionMsg>com.sap.b1i.xcellerator.XcelleratorException: XCE212 Error while performing HTTP call; HTTP status is 403, Forbidden</exceptionMsg>
<returnData>CSRF token validation failed</returnData>

When I was testing with Insonmina and Postman it worked, but I had the same problem using nodejs and was only able to solve it by creating a shared cookie jar between calls, any way to store the cookie I get from the first HTTP call in order to use it in the next HTTP call or simply making the multiple calls in the same "session"? (I am inside the same scenario).

Thanks in advance!

View Entire Topic
StefanoCammilli
Explorer
0 Kudos

Hi Filipe, did you find a solution to this problem?