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

Fix HubConnectionContext.UserIdentifier is null when negotiation with Management SDK #1691

Merged
merged 3 commits into from
Sep 29, 2022

Commits on Sep 28, 2022

  1. Fix HubConnectionContext.UserIdentifier is null

    When clients negotiatie with Management SDK and connect to SignalR server, IUserIdProvider might not work as the user ID is set directly in the Management SDK.
    
    To make HubConnectionContext.UserIdentifier have the valid value in this case, we should set it before the server accesses it. HubLifetimeManager{THub}.OnConnectedAsync(HubConnectionContext) is the only chance we can set the value. However, we cannot access the Constants.ClaimType.UserId as ASRS system claims are trimmed there. HubConnectionContext.Features is the place where we can store the user Id.
    
    The following code is the injection point.
    https://github.com/dotnet/aspnetcore/blob/v6.0.9/src/SignalR/server/Core/src/HubConnectionHandler.cs#L132-L141
    
    Fixes Azure#1679
    Y-Sindo committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    35943fc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ca6365c View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2022

  1. fix test

    Y-Sindo committed Sep 29, 2022
    Configuration menu
    Copy the full SHA
    4289b44 View commit details
    Browse the repository at this point in the history