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

Usage with a single page application #51

Open
TheKnarf opened this issue May 20, 2020 · 3 comments
Open

Usage with a single page application #51

TheKnarf opened this issue May 20, 2020 · 3 comments

Comments

@TheKnarf
Copy link

Can we use nonce's with a SPA application? We don't have any Razor view to modify to add the asp-add-nonce tag, instead, we somehow need the library to take the static files built by Webpack and modify them at runtime to add the nonce tokens.

Is this something this library can do?

@juunas11
Copy link
Owner

At the moment it can't, it only supports the tag helper approach :/

@TheKnarf
Copy link
Author

If I wanted to write my own function that hooked into the spa and rewrote the HTML to insert nonce, does this library export the functions I would need to call into to generate tags or are those hidden inside the library as private methods?

@juunas11
Copy link
Owner

You can inject ICspNonceService where you need the nonce for the current request :)

It's registered by services.AddCsp().

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

2 participants