on 12-26-2022 8:23 AM
Hello experts,
As shown in the tutorial below, I want to display SAP Analytics Cloud stories embedded in a web page.
Embed an SAP Analytics Cloud Story in a Simple Web App | Tutorials for SAP Developers
However, a problem occurs as follows. Could someone please tell me how to solve this?
Details
After logging in to SAP Analytics Cloud (entering the ID and password) as described in 3 of STEP 3 of the tutorial, I confirmed a timeout error when obtaining an access token. In this case, I ran it on a virtual machine remotely connected from my home PC.(The image below is the command prompt log when a timeout error occurs.)
Next, I tried it in the local environment of my home PC instead of the virtual machine.
As a result, the timeout error when obtaining an access token after logging in to SAP Analytics Cloud was resolved, but I confirmed that the SAC story was not displayed on the web page after a successful login.
When I press the "Display Story" button, no story is displayed.
At this time, when I checked the console of the browser (Chrome), the following error message was displayed.
Access to XMLHttpRequest at 'https://<TENANT>/sap/fpa/ui/tenants/<TENANT_ID>/bo/story/<STORY_ID>' from origin 'http://localhost:8081' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
After researching about this error message, I found that I need to add the 'Access-Control-Allow-Origin' header on the server side. However, SAC already allows client-side (local) IP addresses as Trusted Origin.
IP addresses shaded in blue are those of client-side PCs (my home PCs).
Best Regards,
Takasumi Iwahashi
Did you try to use http://127.0.0.1:8081 instead of http://localhost:8081 in the browser?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your reply.
Yes. I tried with http://127.0.0.1:8081. However, the result is an error.
I contacted SAP and they told me that this tutorial is outdated and I should wait until they update it.
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.