-
Notifications
You must be signed in to change notification settings - Fork 10k
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
MapRazorComponents broken with FallbackPolicy RequireAuthenticatedUser #51836
Comments
Thanks for contacting us. We're moving this issue to the |
Is there any kind of workaround here or timeline to a fix? |
dotnet/AspNetCore.Docs#31931 shows another example of someone else running into the same issue but for The workarounds I suggest could be used such as applying the |
@halter73 I ran into this - was getting 302 redirected on the I initially only checked for the specific path that was triggering the challenge but quickly discovered it needed to be a starts-with check. I worked around it with a handler (have since disabled the "global auth" setting due to other issues, though.)
|
This is my workaround for a static SSR project:
This seems to work well, and loudly reminds me when I have forgotten to explicitly set the authorization policy for an endpoint. |
What follows is yet another way to work around the problem. Defining the Fallback policy caused a lot of weird undesirable behavior, but we still wanted to protect our static files. I built what is essentially a wrapper for the StaticFilesMiddleware to ensure authentication before delivering the files.
The UseStaticFile() call is just a wrapper around a UseMiddleWare call to the StaticFileMiddleware so the replacement was luckily very simple.
|
This sounds like it works, but defeats the purpose of having a fallback policy. Sheesh. Am i the only one who wants to protect all pages except a few? |
@boomalator no, you are certainly not. |
Is there an existing issue for this?
Describe the bug
It seems fallback policy is broken for all blazor modes.
results in a redirect to login when requesting
/_framework/blazor.web.js
.ALSO results in a redirect to login when requesting
/_framework/blazor.web.js
.Expected Behavior
Putting Maps before UseAuth... => no auth check
Putting Maps after UseAuth... => auth check for pages, but not for staticfiles
Steps To Reproduce
See above
Exceptions (if any)
No
.NET Version
8.0.100-rc.2.23502.2
Anything else?
No response
The text was updated successfully, but these errors were encountered: