Skip to Content
0
Former Member
Jan 06, 2017 at 10:09 AM

Getting 'CSRF token validation failed' error while flushing Offline Store in native Offline app

5531 Views

Hi All,

We are developing an Android Native Offline app using SMP 3.0 SDK SP13 PL07 and SMP runtime SP11 PL04. We have our OData services implemented on an S/4 Hana system.

We are able to fetch the data and populate offline store successfully. But when we are trying to do transactions (creating / updating entities) and flushing/refreshing the offline store, we are getting 'CSRF token validation failed' error in one of ODataOfflineStoreRequestErrorListener's callback named 'offlineStoreRequestFailed'.

Also when testing in POSTMAN client, we are getting X-CSRF token when executing Get request by putting 'X-CSRF-Token:Fetch' in request headers. So the service is returning required X-CSRF token.

As per some other blog posts, in case of Offline store implementation we don't have to handle X-CSRF tokens explicitly. So we haven't tried to implement extra code for X-CSRF token handling in client side.

Below is screenshot of POSTMAN client where we have fetched X-CSRF token successfully:

1)

Below are the screen shots of configurations done on SMP server.

1)

2)

Kindly help us out here. Thanks in advance.

Kind Regards:

Shubham Kansal

Attachments

setting01.jpg (47.8 kB)
setting02.png (13.2 kB)
postman-client.png (111.8 kB)