Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

SRI implementation in AEM site

Avatar

Level 1

Any one has done Implementation of CSP with Nonce for Inline scripts in AEM as we are using CSP in dispatcher. how we can update Nonce dynamically in CSP and script both?

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
3 Replies

Avatar

Correct answer by
Community Advisor

Avatar

Community Advisor

Hi @ArunJh1 ,

Try below step's:

Step 1: Enable Dispatcher to Pass Dynamic CSP Header

In Dispatcher (Apache HTTPD):

/conf/dispatcher/filters/filters.any

# Allow the CSP header to be passed from AEM
/Header set Content-Security-Policy "script-src 'self' 'nonce-%{CSP_NONCE}e'"

Add to Apache virtual host:

SetEnvIf Request_URI ".*" CSP_NONCE=<%{CSP_NONCE}e>

Avatar

Administrator

@ArunJh1 Did you find the suggestions helpful? If you need more information, please let us know. If a response resolved your issue, kindly mark it as correct to help others in the future. Alternatively, if you discovered a solution on your own, we'd appreciate it if you could share it with the community. Thank you.



Kautuk Sahni