title: How can I add nonce to oauth2-redirect.html inline script when using Content Security Policy
body: <p>I am trying to address the issue I have faced after I added Content Security Policy with the value of &quot;default-src 'self';&quot;. I have fixed the first issue to open swagger by using the solution explained here:
  <a href="https://mderriey.com/2020/12/14/how-to-lock-down-csp-using-swachbuckle/" rel="nofollow noreferrer">https://mderriey.com/2020/12/14/how-to-lock-down-csp-using-swachbuckle/</a></p>
  <p>However, the solution for oauth2-redirect.html didn't work at least to what I have done. I have basically created a swagger folder under wwwroot and add the modified html there.</p>
  <p>I am using the latest swagger nuget packages:</p>
  <pre><code>   &lt;PackageReference Include=&quot;Swashbuckle.AspNetCore&quot; Version=&quot;6.3.0&quot; /&gt;
     &lt;PackageReference Include=&quot;Swashbuckle.AspNetCore.SwaggerUI&quot; Version=&quot;6.3.0&quot; /&gt;
  </code></pre>
  <p>I am really trying to avoid using any unsafe word in the Content Security Policy but open to hear some solutions please.</p>
  <p>Thank you</p>