CSP headers are not working on DXP-7.4
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- Trying to attempt to work with the CSP feature, which is present in update 90 under feature flags, but users are still experiencing issues where they are unable to edit the page and it is continuously loading.
- Navigate to Control Panel> Instance Setting> Features Flag -> Enabled CSP
- Control panel -> System setting -> Content Security Policy -> Added the policy
- It will be reflected here (Control panel -> Instance setting -> Content Security Policy)
- Stop the server and add this: "
javascript.single.page.application.enabled=false" in the portal-ext.properties file
- Restart the server.
-
Observed behavior: When trying to log in via admin user and click on the Edit icon, it shows loading and we can see console browser errors:
Content-Security-Policy warnings 6
Content-Security-Policy: The page’s settings blocked the loading of a resource at inline (“style-src-attr”). 2 combo:1:3389
Content-Security-Policy: The page’s settings blocked the loading of a resource at inline (“style-src-attr”). combo:1:3575
Uncaught SyntaxError: missing } after property list
ecfdb78a-7281-06ba-8be2-4285b9ce2cb5:3318:12463note: { opened at line 3318, column 11935ecfdb78a-7281-06ba-8be2-4285b9ce2cb5:3318:11935
Content-Security-Policy: The page’s settings blocked the loading of a resource at inline (“style-src-attr”). 2 ckeditor.js:100
Content-Security-Policy: The page’s settings blocked the loading of a resource at inline (“style-src-attr”). ckeditor.js:95:231
Content-Security-Policy: The page’s settings blocked the loading of a resource at inline (“style-src”). ckeditor.js:95:231
Content-Security-Policy: The page’s settings blocked the loading of a resource at inline (“style-src-attr”). combo:1:1163
Some cookies are misusing the recommended “SameSite“ attribute 2
This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”.
Resolution
-
This feature is still in beta mode i.e., they are in active development and are not ready for production use. However, Liferay makes these Beta Features available for users to test and validate with their use cases and business objectives, and ultimately provide critical feedback.
-
Please see here: Beta-Features
- Therefore, Liferay support is limited to providing assistance with installation, configuration, or troubleshooting of Beta Features.
Did this article resolve your issue ?