on 09-15-2020 2:58 PM
Hi Experts,
I have generated OData client for custom business object created in S/4 HANA 1909. When i am trying to create an entity using the generated class end up in following error "CSRF token validation failed". Any help?
As per the documentation the create request will fetch CSRF token before issuing the actual create request.
Hi Naga, I also cannot see where the SDK would attempt any CSRF token validation. Only reason I can think of is that you are using a different version of the dependencies com.sap.cloud.servicesdk:odatav2-connectivity-sdk and com.sap.cloud.servicesdk:odata-v2-lib. The SDK uses 1.40.6.
In any case, you can replace execute with executeRequest in your code. The latter will not fail if a service does not support CSRF tokens and execute the request without a CSRF token. Also it will tell you exactly what went wrong during CSRF token retrieval if the overall request fails. You can check out the details in the release nots.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.