on 03-20-2018 4:51 PM
I am having a few problems with cross-origin policy while trying to access the C4C Odata service. The application is hosted as a BSP application on an ABAP system.
As per the guide (https://github.com/SAP/C4CODATAAPIDEVGUIDE), i am trying to make a simple call to retrieve the x-csrf-token to use in subsequent calls.
Any request made to the domain https://my*****/sap/c4c/odata/v1/c4codata/ is blocked due to CORS issues. I need to add a request header {"x-csrf-token":"fetch"} that triggers a preflight OPTIONS request, which does not allow authentication and fails.
I tried with xhr requests, ajax requests and odata models, but to no result.
What could I do to solve this issue?
Edit: I tried different borwsers to make sure and it is not a Chrome specific issue.
Hello Giovani,
Currently CORS is not supported in C4C OData consupmtion.
This functionality will be made available in one of the future releases of C4C.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
since three years no (good) news here - maybe you want to vote for this Idea https://influence.sap.com/sap/ino/#/idea/277034
Regards, René
Hi Giovanni,
since C4C does not support CORS as Aelia Azevedo wrote above you could also try out one of the following two options:
1) use a reverse Proxy that has to be placed in front of both systems. (for example a SAP web dispatcher)
2) use the following workaround for CORS that has been described by dong.pan in his blog https://blogs.sap.com/2017/02/08/how-to-enable-cors-on-sap-netweaver-platform/
Best Regards,
Andre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Do you have the issue with the simple GET request?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do, unfortunately as per Aelia Azevedo's answer it is still an unsupported functionality in C4C. Thank you anyway!
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.