Hi @Vishnu9,
nonce is supposed to be an unguessable, random value that the server generates individually for each response. Therefore I suggest you define your CSP header in the AEM Publish, instead of Dispatcher.
Here are the high-level steps to follow:
- Generate an unguessable, random value in AEM individually for each response
- Return the CSP header including script-src 'nonce-{SERVER-GENERATED-NONCE}'
- Use the generated nonce for loading your inline script <script nonce='{SERVER-GENERATED-NONCE}'>
Good luck,
Daniel