cancel
Showing results for 
Search instead for 
Did you mean: 

How to use XSRF Token in REST Adapter,SAP PO 7.5 SP17

anand_shankar10
Active Participant
0 Kudos

Hello Experts,

Got to know that the REST adapter has a new feature to call X-CSRF Token from the OData service and use it to call the actual service in the same call. the config also gives us the option to post specifc URL to GET CSRF token which can be further used in simultaneous next POST call. But its not working. Any pointers or a demo will be highly appreciated.

Regards

Anand

JaySchwendemann
Active Contributor

It is not working is not a useful error situation descritpion.

  • Where are you failing
  • What have you tried
  • What to do want to achieve
  • Error text / log

Guts feeling: Have a look at XPI Inspector Trace (Example 50) with REST RCV Channel.

Accepted Solutions (0)

Answers (3)

Answers (3)

JaySchwendemann
Active Contributor

As stated in my comment to the OP I would have a look using XPI Inspector Example 50.

I will assume, you configured the REST receiver adapter along https://launchpad.support.sap.com/#/notes/2757524

I would think that Postman will do an http header fetch and that this is the way your S/4HANA instance will issue CSRF tokens. So when you configured your REST receiver with "GET" you will not do the same, postman does.

But since my crystall ball broke lately, I'm having a hard time telling... ya know 😉

anand_shankar10
Active Participant
0 Kudos

But Thanks indeed for spending your time on it.

I believe REST feature is to reduce two step process. One step to Fetch token through GET Call and another to use token for a POST Call.But if that's not what I am looking for then, guess I will have to keep with gateway solution.

JaySchwendemann
Active Contributor
0 Kudos

REST Adapter has Options GET, OPTIONS, HEAD. I would simply suggest you try those and use XPI inspector to see what's what

Disclaimer: I do not have a running scenario for that so I'm just guessing by looking at the docs, so YMMV. I'm not voluntarly holding back any information, if that is what you thining

anand_shankar10
Active Participant
0 Kudos

your one liner is not helpful.

If you can help me with config details, that will be great for me to use SAP PO, else I have a working solution through AWS-API Gateway, but if this works, I won't need two step process, hence trying to get help through experts..

JaySchwendemann
Active Contributor

This again is should not be an answer, you are cluttering the thread with this. I was just composing an answer myself (but that took a little longer than you jotting out this "answer") So see below (https://answers.sap.com/answers/13157484/view.html)

anand_shankar10
Active Participant
0 Kudos

jens.schwendemann I have a third party application which wants to create Sales Order using an OData Service. What I did is created a passthrough scenario and configured the url for getting X-CSRF Token using GET in REST Channel.

And Actual end point is configured under REST url. When I run this, the error comes: No XSRF Token returned from S4. Whereas if I run a x-csrf Fetch call from Postman directly to S4, I get X-CSRF Token. I want to know precise config in REST Channel.

Thanks for your feedback.

JaySchwendemann
Active Contributor

This should really be a comment to my comment of the OP