Skip to main content

Hi,

I am trying to create a CRUD workflow using K2 and SAP. On SAP side we have exposed the functionality as OData service. I followed the video https://www.youtube.com/watch?v=sFjfS65CO1E and set up the OData Service broker as Service instance in K2. The SmartObject generated lists all the CRUD operations and the list function executes without any issues. The other operations create/update/delete fail with a message - CSRF token validation failed.

As per the article - https://help.sap.com/saphelp_gateway20sp12/helpdata/en/e6/cae27d5e8d4996add4067280c8714e/frameset.htm

the list function which is a non-modifying request sends a request header property x-csrf-token=fetch and retrieves a CSRF token. This token should be then used as request header property for the modifying requests. 

How can I set this up ? 

I have not found much information on CRUD operations for K2 + SAP using OData so any help is much appreciated. 

Hi ns1


 


Check the attached link below:


https://help.k2.com/onlinehelp/k2five/devref/5.0/default.htm#Controls/CSRF-Validation.htm 


 


Regards


Elvis


Thank you for your quick reply. I did see that article but this involves code updates and also we are using K2 Cloud rather than K2 Five. Does it still apply ?

 


Can anybody help in retrieving a response header from a OData SmartObject ? I can then get the csrf token sent by SAP Gateway.


We got round the issue by not passing x-csrf-token not ideal but atleast we got something running. I did manage to retrieve response headers but K2 does not supply them for list method.


Reply