cancel
Showing results for 
Search instead for 
Did you mean: 

CSRF token for SAP Gateway Post service

pranay_aitha2
Participant
0 Kudos

Hi All,

I am trying to disable the CSRF check for a gateway service, I have found this help document and followed it.

Cross-Site Request Forgery Protection - SAP Documentation

As suggested, I added the config parameters in SICF and set the below parameters.

  • Parameter Name: ~CHECK_CSRF_TOKEN
  • Parameter Value: 0/1 (disable/enable)

But the service still runs only with a csrf  token.

Thanks in Advance!!

Regards,

Pranay Aitha.

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor

Hi Pranay,

Check Ralf's answer here.

http://scn.sap.com/thread/3447410

Thanks

Krishna

pranay_aitha2
Participant
0 Kudos

Thanks Krishna,

That helped us a lot!!

Aisurya
Participant
0 Kudos

Hi Krishna,

Getting the same error .

I added the parameter ~CHECK_CSRF_TOKEN = 0 in the GW POST service in SICF, but also am getting the error "CSRF token validation failed"

Below is the Screenshots from the Rest Client :

Please help me in this.

Thanks,

Aisurya

former_member195242
Active Participant
0 Kudos

Hi Aisurya,

Try this in your HTTP header-

X-Requested-With=XMLHttpRequest

Best regards,

Aakash

Aisurya
Participant
0 Kudos

Hello Aakash,

Getting the same error again.  " CSRF token validation failed " .

Thanks ,

Aisurya

pranay_aitha2
Participant
0 Kudos

Hi Aisurya,

Did you try this??

in the first call

X-CSRF-Token=X

in the first call response, you get a value of the token like 'Xcdil35895=='

this value must be sent as response back in the POST or PUT service.

Regards,

Pranay Aitha

Answers (0)