Switch to turn CSP script hash off
Hi, can you provide an option for turning CSP security headers off as shown here:
https://github.com/IdentityServer/IdentityServer4/blob/master/src/IdentityServer4/src/Endpoints/Results/AuthorizeResult.cs#L130
We are behind corporate infrastructure and Penetration testing results advised that we set Content-Security-Policy at IIS root, and all sites inherit from it. This caused us an issue with Safari only where the user was stuck on a white screen, triaging resulted in a CSP issue with the inline script that submits the form on callback page. ID Srv code appends the script-src csp as defined here: https://github.com/IdentityServer/IdentityServer4/blob/master/src/IdentityServer4/src/Endpoints/Results/AuthorizeResult.cs#L130 and then IIS headers are played, there becomes 2 script-src policies in the header and i found that this was invalid using csp validator
For now, i have intercepted the response headers and removed the Content-Security-Policy one using some middle ware and it gets me around the issue i faced.
For now i used some middle ware to remove the Content-Security-Policy header.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Questions are community supported only and the authors/maintainers may or may not have time to reply. If you or your company would like commercial support, please see here for more information.
I'm torn on this issue. Sometimes you need code on the request to render the CSP headers because of what's on the specific response, so I don't necessarily agree with the approach of a one-size fits all CSP directive on your reverse proxy.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Questions are community supported only and the authors/maintainers may or may not have time to reply. If you or your company would like commercial support, please see here for more information.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.