Document SignalR authentication refresh endpoint, refresh context, and hub override - #37692
Draft
wadepickett with Copilot wants to merge 4 commits into
Draft
wadepickett with Copilot wants to merge 4 commits into
wadepickett with Copilot wants to merge 4 commits into
Conversation
Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update documentation for SignalR authentication refresh
Document SignalR authentication refresh endpoint, refresh context, and hub override
Sep 20, 2026
wadepickett
reviewed
Sep 20, 2026
wadepickett
reviewed
Sep 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
The .NET 11 SignalR authentication refresh feature is already covered in depth in xref:signalr/authn-and-authz, but four elements were missing: the
/refreshendpoint has no route, method, or registration semantics documented anywhere;AuthenticationRefreshContextmembers are used in examples but never listed;OnAuthenticationRefreshedAsyncisn't discoverable from the Hubs API article; and the .NET client article has no path to the feature. These changes fill those gaps without rewriting or duplicating the existing Authentication refresh section.Changes
aspnetcore/signalr/authn-and-authz.md(inside the existing>= aspnetcore-11.0zone)/refreshendpoint: route template{hub-path}/refresh,POST-only (405 otherwise), connection token in theidquery string, the 200 +tokenLifetimeSecondssuccess payload, and the 403/404/400 failures carrying anerrorproperty. Notes that the endpoint is registered only whenEnableAuthenticationRefreshistrue, plus guidance to allow the route through reverse proxies, firewalls, and route-scoped authorization/CORS policies.AuthenticationRefreshContextproperties (PreviousUser,NewUser,NewExpiration,ConnectionId,HttpContext), including thatMaximumAuthenticationExpirationis applied before the callback runs.aspnetcore/signalr/hubs.md— surfacesOnAuthenticationRefreshedAsyncin "Handle events for a connection" alongsideOnConnectedAsync/OnDisconnectedAsync, cross-referencing the full feature rather than duplicating it. Requires splitting the enclosing>= aspnetcore-8.0moniker zone.aspnetcore/signalr/dotnet-client.md— adds a short>= aspnetcore-11.0section pointing to the feature.ms.datebumped on all three articles;ai-usage: ai-assistedadded tohubs.mdanddotnet-client.md.Two corrections relative to the issue's proposed text
Each new statement was verified against product source in
dotnet/aspnetcore@1fcd7ef, which contradicted the issue in two places:Callback exceptions. The issue proposed "if the callback throws, the refresh is rejected." The
HttpConnectionDispatcherOptions.OnAuthenticationRefreshinvocation isn't wrapped in a try/catch (HttpConnectionContext.cs:366-374), so the exception propagates out of the/refreshrequest — asserted byRefreshOnAuthenticationRefreshCallbackExceptionPropagates. Only the connection-levelIConnectionAuthenticationRefreshFeaturecallback has throw-means-reject semantics. The documented behavior reflects the former.Client auto-refresh default.
HubConnectionfalls back tonew AuthenticationRefreshOptions()when none are registered (HubConnection.cs:286), so auto-refresh is on by default andWithAuthenticationRefreshonly retunes or disables it — it isn't the opt-in switch. The existing sentence ("To refresh automatically… callWithAuthenticationRefresh") would have contradicted the new client-article text, so it was adjusted:This one-sentence fix is the only edit outside the four listed gaps. No TOC or redirection changes are needed.
Internal previews
Build report