Questa pagina non è ancora tradotta in italiano: qui la trovi in inglese.
MentorServerUserContext class
The MentorServerUserContext class of Novior.MentorAgent.Server.Auth: Scoped holder for the authenticated principal of a SignalR connection. Each connection…
On this page
Scoped holder for the authenticated principal of a SignalR connection. Each connection has one DI scope of its own (MentorHubScopes), built on connect and reused for every hub method; SignalR's own scope per method call is not the one MentorAgent runs in. MentorHub writes Context.User into this holder at the start of each method (with the connection id), so the principal is the current one even if the connection's token was refreshed. ServerAuthenticationStateProvider then surfaces it to the MentorAgent core, which resolves the current user through the standard AuthenticationStateProvider abstraction.
Definition
Section titled “Definition”Namespace: Novior.MentorAgent.Server.Auth. Package: Novior.MentorAgent.Server.
public sealed class MentorServerUserContext
dotnet add package Novior.MentorAgent.ServerConstructors
Section titled “Constructors”public MentorServerUserContext()
Properties
Section titled “Properties”public ClaimsPrincipal? User { get; set; }
The authenticated principal for the current hub invocation, if any.
