Support user identifier changes during SignalR authentication refresh - #68494
Closed
kotlarmilos wants to merge 2 commits into
Closed
Support user identifier changes during SignalR authentication refresh#68494kotlarmilos wants to merge 2 commits into
kotlarmilos wants to merge 2 commits into
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A SignalR connection is aborted when an authentication refresh resolves to a different user identifier, which tears down the Blazor Server circuit whenever the signed in user changes.
HubOptions.AllowUserIdentifierChangeOnAuthenticationRefreshallows the connection to adopt the new identifier instead of aborting.HubLifetimeManager<THub>.OnUserIdentifierChangedAsyncis a new virtual hook that lets backplanes re-key user delivery, andRedisHubLifetimeManageroverrides it to move the connection to the new user channel. The option defaults tofalseand the base hook is a no-op, so existing behavior is unchanged. The/refreshendpoint accepts a missing authentication result on endpoints that allow anonymous access, which is required because a sign out produces no result. Product code and tests are in separate commits. The public API additions need review.Fixes #68284