dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.31k stars 9.97k forks source link

Server-side Blazor Disable IUserIdProvider ? #58112

Open 17723010593 opened 1 week ago

17723010593 commented 1 week ago

I enabled Server-side Blazor on my aspnetcore Server, I injected GameRoleIdProvider

builder.Services.AddSingleton<IUserIdProvider, GameRoleIdProvider>(); However, blazor also calls GameRoleIdProvider, there is no way to disable blazor from calling GameRoleIdProvider

mkArtakMSFT commented 1 week ago

Thanks for contacting us. Blazor Server resolves that service because it utilizes SignalR internally. That said, it's not going to interfere with Blazor, because even though it causes the GetUserId method to get called, its result is ignored by Blazor since it only communicates with the "Caller" and not with any specific "User" name.

That said, we'll let the SignalR team know about this as a feature request to allow registering independent IUserIdProvider instances in the future.

Having said this, can you also share more about why this is a problem for you?

dotnet-policy-service[bot] commented 1 week ago

Hi @17723010593. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

dotnet-policy-service[bot] commented 1 day ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.