1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-17 08:02:54 +08:00
osu-lazer/osu.Game/Online
Bartłomiej Dach 3006bae0d8
Send client-generated session GUID for identification purposes
This is the first half of a change that *may* fix
https://github.com/ppy/osu/issues/26338 (it definitely fixes *one case*
where the issue happens, but I'm not sure if it will cover all of them).

As described in the issue thread, using the `jti` claim from the JWT
used for authorisation seemed like a decent idea. However, upon closer
inspection the scheme falls over badly in a specific scenario where:

1. A client instance connects to spectator server using JWT A.

2. At some point, JWT A expires, and is silently rotated by the game in
   exchange for JWT B.

   The spectator server knows nothing of this, and continues to only
   track JWT A, including the old `jti` claim in said JWT.

3. At some later point, the client's connection to one of the spectator
   server hubs drops out. A reconnection is automatically attempted,
   *but* it is attempted using JWT B.

   The spectator server was not aware of JWT B until now, and said JWT
   has a different `jti` claim than the old one, so to the spectator
   server, it looks like a completely different client connecting, which
   boots the user out of their account.

This PR adds a per-session GUID which is sent in a HTTP header on every
connection attempt to spectator server. This GUID will be used instead
of the `jti` claim in JWTs as a persistent identifier of a single user's
single lazer session, which bypasses the failure scenario described
above.

I don't think any stronger primitive than this is required. As far as I
can tell this is as strong a protection as the JWT was (which is to say,
not *very* strong), and doing this removes a lot of weird complexity
that would be otherwise incurred by attempting to have client ferry all
of its newly issued JWTs to the server so that it can be aware of them.
2024-07-17 15:56:41 +02:00
..
API Send client-generated session GUID for identification purposes 2024-07-17 15:56:41 +02:00
Chat Allow more lenient parsing of incoming timestamps 2024-06-18 13:13:50 +02:00
Leaderboards Merge branch 'master' into LeaderBoardScore_clean 2024-06-07 22:42:49 +03:00
Metadata Use room watching functionality to receive realtime daily challenge updates 2024-06-28 13:35:16 +02:00
Multiplayer Fix room status not updating when password is changed while inside the room 2024-05-03 11:37:09 +02:00
Notifications/WebSocket Fix ruleset medals not displaying due to deserialisation failure 2024-03-11 21:34:10 +01:00
Placeholders Fix various other inspections 2023-10-17 17:48:51 +09:00
Rooms Add results screen for displaying arbitrary daily challenge scores 2024-07-04 13:45:24 +02:00
Solo Move away from Solo namespace 2024-02-29 01:21:17 +03:00
Spectator Fix SpectatorClient holding references to Player 2024-04-03 17:32:02 +09:00
BeatmapDownloadTracker.cs Bring realm library up-to-date 2023-07-06 13:37:43 +09:00
DevelopmentEndpointConfiguration.cs Remove no longer relevant changes 2024-01-29 09:05:03 +01:00
DownloadState.cs Fix playlist items showing download button briefly during initial local presence checks 2022-09-08 17:10:45 +09:00
DownloadTracker.cs Partial everything 2022-11-27 00:00:27 +09:00
EndpointConfiguration.cs Update endpoints to final production endpoints 2024-01-30 18:40:17 +09:00
HubClient.cs Rename StartAsync -> ConnectAsync 2022-11-02 11:44:16 +09:00
HubClientConnector.cs Send client-generated session GUID for identification purposes 2024-07-17 15:56:41 +02:00
IHubClientConnector.cs Implement client-side disconnection flow 2023-11-21 15:15:45 +09:00
ILinkHandler.cs Add and use ILinkHandler interface 2022-06-20 20:04:21 +02:00
IStatefulUserHubClient.cs Add extended xmldoc to DisconnectRequested() 2024-02-16 13:09:36 +01:00
OnlineStatusNotifier.cs Handle forced logouts due to password change too 2024-01-26 10:53:27 +01:00
OnlineViewContainer.cs Update APIState checks 2023-11-16 20:39:23 +09:00
PersistentEndpointClient.cs Add/adjust xmldocs 2022-11-02 13:16:34 +09:00
PersistentEndpointClientConnector.cs Use staggered exponential backoff when retrying in PersistentEndpointClientConnector 2024-02-06 15:40:30 +01:00
PollingComponent.cs Partial everything 2022-11-27 00:00:27 +09:00
ProductionEndpointConfiguration.cs Remove no longer relevant changes 2024-01-29 09:05:03 +01:00
ScoreDownloadTracker.cs Add LegacyOnlineID handling to places that definitely need it 2023-10-16 11:20:02 +02:00
SignalRDerivedTypeWorkaroundJsonConverter.cs Fix the MOTHERLOAD of undetected issues that are now visible thanks to net6.0 2022-12-16 18:16:26 +09:00
SignalRUnionWorkaroundResolver.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
SignalRWorkaroundTypes.cs Simplify UserActivity for serialisability over the wire 2023-12-06 18:52:26 +01:00
UserStatisticsUpdate.cs Move away from Solo namespace 2024-02-29 01:21:17 +03:00
UserStatisticsWatcher.cs Move away from Solo namespace 2024-02-29 01:21:17 +03:00