Replies: 1 comment
-
Am having the issue , any known solution? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey community,
Has anyone been able to get Authorization ONLY working in Net 8 Blazor Web App.
This was fairly trivial in Net 7 with .AddAuthorizationCore() and then a custom implementation of AuthenticationStateProvider
In Net 8 I've gone down this insane rabbit hole of building my own AuthScheme and Handler with all sorts of smell because you can't seem to utilize an Authorize attribute without have an IAuthenticationHandler registered. Which forces an undocumented journey of identity woes to have a custom Authentication subsystem that only needs to expose Authorization requirements to the client. In a sense a BFF where the Blazor host process is nearly UI and Authorization and Authentication is out of process against an API.
Any thoughts?
Edit: I may have had a thought here and that is to forgo any usage of attribute authorization and wrap everything in AuthorizedView because it seems like the behavior of the component is to only run a check against your AuthenticationStateProvider
I will go down this path a little bit and report back.
Edit: Yes this is the pathway you must traverse for Authorization only. You must have an Authentication infrastructure in place to utilize Authorize Attributes.
Edit: So I'm quite sure the last path is the correct one but I'll tell you something. Services and there construction behavior make 0 fucking sense in .Net 8 Blazor. No matter what my scoped services are newed up with every single signalr request. Can't figure away around it.
Beta Was this translation helpful? Give feedback.
All reactions