Skip to content

Clear redirected SignalR access tokens before restarting negotiation - #69916

Closed
fredrikbernholm wants to merge 1 commit into
dotnet:mainfrom
fredrikbernholm:fix/signalr-cookie-reconnect-token
Closed

fredrikbernholm wants to merge 1 commit into
dotnet:mainfrom
fredrikbernholm:fix/signalr-cookie-reconnect-token

Conversation

@fredrikbernholm

Copy link
Copy Markdown

A cookie-authenticated client that negotiates through an Azure SignalR redirect can connect once but fail every automatic reconnect. The cached bearer token from the service redirect survives the next HttpConnection.start(), so the client sends that service token to the original application's negotiate endpoint even though no application accessTokenFactory is configured.

Clear the cached HTTP token when a connection starts, alongside restoring the application's token factory. The original endpoint can then use cookie authentication again, and the redirected service receives its newly negotiated token.

The regression starts, stops and restarts a connection with a negotiate redirect, checking the Authorization header at both endpoints. It fails on current main before the fix. All 84 HttpConnection tests pass with the fix, and the touched test file passes ESLint.

Also reproduced against a live Azure SignalR deployment with client 9.0.6: the initial connection and group subscription succeeded, but terminating the WebSocket caused subsequent application negotiations to return 404 with the service bearer token attached. Clearing the cache restored negotiation, automatic reconnect, group rejoining and backend push delivery. A released-client regression also fails before the fix and passes afterward.

@github-actions github-actions Bot added the area-signalr Includes: SignalR clients and servers label Oct 18, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Oct 18, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @fredrikbernholm. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@fredrikbernholm

Copy link
Copy Markdown
Author

Replaced with bug report #69917 so the issue can be triaged before proposing a change.

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

Labels

area-signalr Includes: SignalR clients and servers community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant