Enables you to manage Content Security Policy (CSP) for both the front and back end, via CMS section.
dotnet add package Umbraco.Community.CSPManager
You will also need to give access via the users section to the CSP Manager section.
To use CSP nonce you can make use of the Tag Helper.
First you will need to include the namespace in the ViewImports.cshtml
@addTagHelper *, Umbraco.Community.CSPManager
To use the nonce add the following to your <script>
or <style>
tags:
csp-manager-add-nonce="true"
When this is added it will include the nonce in the CSP header and output in the page.
If you need to access the nonce within a data attribute you can use the following:
csp-manager-add-nonce-data-attribute="true"