-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SignalR] Close connection on auth expiration #32431
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
Conversation
How would you have acquired a new token without a new request?
I don't think JWT auth will even validate a token without the exp property? |
src/SignalR/common/Http.Connections/src/Internal/HttpConnectionDispatcher.cs
Outdated
Show resolved
Hide resolved
src/SignalR/common/Http.Connections/src/Internal/HttpConnectionContext.cs
Outdated
Show resolved
Hide resolved
src/SignalR/common/Http.Connections/src/Internal/HttpConnectionManager.cs
Outdated
Show resolved
Hide resolved
067b4cf to
60dbf28
Compare
|
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
5fa972c to
334e5a8
Compare
src/SignalR/common/Http.Connections/src/Internal/HttpConnectionDispatcher.cs
Outdated
Show resolved
Hide resolved
src/SignalR/common/Http.Connections/src/Internal/HttpConnectionManager.cs
Outdated
Show resolved
Hide resolved
|
What's the state of this PR? |
I think it's good to go, just needs review(s) |
src/SignalR/common/Http.Connections/src/Internal/HttpConnectionContext.cs
Outdated
Show resolved
Hide resolved
src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs
Outdated
Show resolved
Hide resolved
src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs
Outdated
Show resolved
Hide resolved
|
|
||
| if (connectionContext.Features.Get<IConnectionLifetimeNotificationFeature>() is IConnectionLifetimeNotificationFeature lifetimeNotification) | ||
| { | ||
| // This feature is used by HttpConnectionManager to gracefully close the connection on authentication expiration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems weird to me to call it graceful when we're calling abort:
| // This feature is used by HttpConnectionManager to gracefully close the connection on authentication expiration | |
| // This feature is used by HttpConnectionManager to close the connection with a non-errored close message on authentication expiration. |
Or should we include an error in the close message indicating that auth expired?
|
Any particular reason for not adding an error to the close message? |
I think it's a good idea, but the code isn't setup currently to allow it easily. I think we need to update how we do the CloseMessage in a different change. Do you remember if we had an issue tracking the CloseMessage race? |
src/SignalR/common/Http.Connections/src/HttpConnectionDispatcherOptions.cs
Outdated
Show resolved
Hide resolved
I looked briefly, but didn't find one. |
Filed #34294 |
|
Hi @mcguu. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
Part of #5297
Open questions:
If expiration of token happens, can we first run auth again to check if the token hasn't had its expiry updated?public class HttpConnectionDispatcherOptions { + bool EnableAuthenticationExpiration { get; set; } }