Skip to content

Support user identifier changes during SignalR authentication refresh - #68494

Closed
kotlarmilos wants to merge 2 commits into
dotnet:mainfrom
kotlarmilos:milosk/signalr-user-identifier-change
Closed

Support user identifier changes during SignalR authentication refresh#68494
kotlarmilos wants to merge 2 commits into
dotnet:mainfrom
kotlarmilos:milosk/signalr-user-identifier-change

Conversation

@kotlarmilos

@kotlarmilos kotlarmilos commented Aug 13, 2026

Copy link
Copy Markdown
Member

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.AllowUserIdentifierChangeOnAuthenticationRefresh allows the connection to adopt the new identifier instead of aborting. HubLifetimeManager<THub>.OnUserIdentifierChangedAsync is a new virtual hook that lets backplanes re-key user delivery, and RedisHubLifetimeManager overrides it to move the connection to the new user channel. The option defaults to false and the base hook is a no-op, so existing behavior is unchanged. The /refresh endpoint 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

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Blazor Server identity changes during SignalR authentication refresh

3 participants