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

Consider registering the authentication state provider conditionally #41235

Closed
javiercn opened this issue Apr 18, 2022 · 3 comments · Fixed by #41247
Closed

Consider registering the authentication state provider conditionally #41235

javiercn opened this issue Apr 18, 2022 · 3 comments · Fixed by #41247
Assignees
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-server feature-blazor-server-auth good first issue Good for newcomers. help wanted Up for grabs. We would accept a PR to help resolve this issue
Milestone

Comments

@javiercn
Copy link
Member

Use TryAddScoped here instead of AddScoped

services.AddScoped<AuthenticationStateProvider, ServerAuthenticationStateProvider>();

It's not clear to me why we do this, but I suspect that it is because in the past we might have had a different implementation registered by default inside MVC for rendering components statically.

I don't believe we need this any longer and it creates a hard to debug issue for our customers as it forces an order when customers want to provide a custom implementation (on something that we tell customers to customize).

I can't foresee any drawback on changing this to use TryAddScoped instead, so we should do so.

@javiercn
Copy link
Member Author

This issue came as a result of looking into #41228

@javiercn javiercn added this to the .NET 7 Planning milestone Apr 18, 2022
@ghost
Copy link

ghost commented Apr 18, 2022

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@javiercn javiercn added help wanted Up for grabs. We would accept a PR to help resolve this issue good first issue Good for newcomers. labels Apr 18, 2022
@damienbod
Copy link
Contributor

Hi @javiercn I could try this one if you want, I would like to look the Blazor authentication anyway.

@mkArtakMSFT mkArtakMSFT modified the milestones: .NET 7 Planning, 7.0-rc2 Jul 26, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-server feature-blazor-server-auth good first issue Good for newcomers. help wanted Up for grabs. We would accept a PR to help resolve this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants