Symptom
- Unable to add the custom widget into the story.
- Error message: "Content Security Policy(CSP) Error occurred, Please review your 'required' CSP Settings."
Blocked URI / Missing Value: "https://xxxxxxxxx"
Problematic Directive: "script-src-elem"
Current CSP Policy: "script-src 'self' 'unsafe-eval' ......
Environment
SAP Analytics Cloud
Reproducing the Issue
- Log onto the SAP Analytics Cloud system.
- Open a story.
- Insert any custom widget into the story.
- Observe that only a blank widget is added into the story.
- Check the console log and observe the error message indicating a violation of the Content Security Policy directive.
Cause
The issue is caused by the Content Security Policy (CSP) settings in the SAP Analytics Cloud system.
In detail, the Content Security Policy is enabled under the Security tab of the Administration module in this SAC system. However, the blocked URL is not added in the trusted list.
Resolution
- Navigate to the Administration module in SAP Analytics Cloud.
- Access the Security tab.
- Add the blocked URI to the trusted list under Content Security Policy settings.
- Alternatively, disable the Content Security Policy.
- Verify that the custom widget can be added in the optimized story now.
Keywords
content security policy, csp error, script-src-elem, custom widget, optimized story, sap analytics cloud, blocked uri, trusted list, csp settings, script loading error, widget issue, data visualization, story component, Content Security Policy(CSP) Error occurred, Please review your 'required' CSP Settings , KBA , LOD-ANA-UNS-SDK , Unified Story Custom Widget and Hosting , Problem
SAP Knowledge Base Article - Public