cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CSRF token validation failed

0 Likes
4,955

Hello Experts,

I am building an interface to post an attachment to S/4HANA using API_CV_ATTACHMENT_SRV entity. I am passing all the required headers to this entity but still I am getting CSRF token validation failed error. Please find below screenshot for your reference. Request you to please suggest a workaround for the stated issue.

Below groovy script used to pass Cookie header

import com.sap.gateway.ip.core.customdev.util.Message;
import groovy.xml.*;
import java.io.*;
 
def Message processData(Message message) 
{
    def headers = message.getHeaders();
    def cookie = headers.get("set-cookie");
     message.setHeader("Cookie", cookie);
    return message;
}

View Entire Topic
jdavanzo
Explorer
0 Likes

Hi Varun,

did you manage to solve the problem?

I am having the same issue using the HTTP channel to update data in S/4HANA.

Unfortunately I cannot use the oData receiver adapter because the service I am using does not support navigation.

Regards,

John