cancel
Showing results for 
Search instead for 
Did you mean: 

CSRF token is not working in Put action but it is valid

Former Member
0 Kudos

Hi All,

I am calling a getway service with Put action from the third party software.

While doing this I am getting the x-csrf-token using the get method for the same.

When I pass this CSRF token, error says that the Token is invalid.

When I checked the same in debugging ( SAP side ) I found that the moment I raise put action, another CSRF token get created and as I pass the old one the error is coming.

Please provide your inputs if you have any idea about this issue.

Let me if more information is needed to explain my problem.

Regards,

Anmol Bhat

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Any update on this please.

dinakaran_g
Explorer
0 Kudos

Hi,

You have to use same token for GET and PUT Or Separately.

Former Member
0 Kudos

Hi Dinakaran,

Thanks a lot for your reply.

Actually I get another Token on Put action.

Strange isn't it.

dinakaran_g
Explorer
0 Kudos

Hi,

Can you please explain your flow..

Former Member
0 Kudos

In My Third Party System,

I am first calling Get action and passing X-CSRF-TOKEN as Fetch.

Then I use this Token and call Put action sending X-CSRF-TOKEN which we got from Get Action.

It is raising the error message at my third party system saying "X-CSRF-Token Invalid".

Then I debugged the SAP system and found that the Token which I got in Get method and the current valid token is different and also found that when I am calling the Put method then the new token is generated at SAP side and because of this the error is raising.

Please let me know if more info is needed.

Regards,

Anmol Bhat

dinakaran_g
Explorer
0 Kudos

Hi,

Actually I got this type of error. I try to fetch the token with two different services, so that error occurred.

Check Authorization Parameter also..