Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using SHA. How do I use it? #69

Open
gatecrasher63 opened this issue Mar 9, 2023 · 4 comments
Open

Using SHA. How do I use it? #69

gatecrasher63 opened this issue Mar 9, 2023 · 4 comments

Comments

@gatecrasher63
Copy link

No description provided.

@gatecrasher63
Copy link
Author

I have an issue with inline styles using MTCaptcha in an IFrame. I am getting loads of errors from the browser, refused to allow inline style

I can specify unsafe-inline but I don't want to. Using Nonce doesn't help

The error shows me an SHA value and I am being told to specify that

Can I do that on some way. I was looking for something along the lines of ".Allow("SHA....") but there doesn't seem to be an option. How would I go about doing this?

@gatecrasher63 gatecrasher63 changed the title Using SHA. How di Using SHA. How do I use it? Mar 9, 2023
@juunas11
Copy link
Owner

This might not be possible at the moment. An update could be made that would allow something like:

csp.AllowStyles.WithHash("sha256-RFWPLDbv2BY+rCkDzsE+0fr8ylGr2R2faWMhq4lfEQc=");

or in configuration:

{
  "Csp": {
    "Style": {
       "AllowedHashes": [
         "sha256-RFWPLDbv2BY+rCkDzsE+0fr8ylGr2R2faWMhq4lfEQc="
       ]
    }
  }
}

@gps-lasrol
Copy link
Contributor

@juunas11 i have created a PR for this issue.

@juunas11
Copy link
Owner

The PR has been merged. I was already working on a 5.0.0 version and included the changes in that. It should be available on Nuget soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants