Nonce not working in asp.net core mvc
See original GitHub issueHi
I followed your guide on the readme but I cant get the nonce to work, unsafe inline is working fine.
I have created a testproject where I add the
services.AddCsp(nonceByteAmount: 32);
in the configureservices section and the
app.usecsp in the Configure section with .AddNonce()
added the taghelper in the viewimport
and added the asp-add-nonce=“true” to the script tag. It also get the auto completion for that tag.
but when i start the website i get an error that it violates the csp rules because the inline doesnt have a nonce.
I added the nonce in the index.cshtml
here the testproject to download : https://www.dropbox.com/sh/9ykavf5c0kik6j7/AABNY-Tsnm8WK3tftgw7lj9Sa?dl=0
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
ASP.net MVC Application having Nonce Problem in ...
1 Answer 1 · Firstly, please check if you have given the correct domain name and verify. · Visual Studio IIS Express which...
Read more >NONCE not supported in Asp.Net for CSP implementation
I read that NONCE was not supported in Asp.Net, however, I read another simple article, that shows how it is done? Does anyone...
Read more >Microsoft login issue in asp.net mvc 5 custom application
When I deployed it on Azure AD app and tested it, login is not working. It is redirecting again again to login page...
Read more >Content-Security-Policy Nonces in ASP.NET and OWIN
First, it securely generates a 32 byte random nonce. There are no specific guidelines on how big a nonce should be, but a...
Read more >CSP after applying "script-src 'self' " Kendo control doesn't ...
Our assumption is there are dynamic inline scripts generated for kendo controls which not contains nonce. so it may cause an issue.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks, my issue is indeed resolved after using version 3.0.0.
Cheers. Also, unrelated. Tried in aspnet core 3.0 and not getting the auto completion.