-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
User-Interactive Auth sessions need to be replicated across the processes of a worker-mode deployment #6705
Comments
Also slightly worrying as I think mobile use this to do recaptcha...? |
We should investigate if this is actually breaking clients. |
Yes, it is breaking clients. I can confirm that, as I just implemented the user interactive auth part of registration in nheko. Basically we try the first stage, but after the user completed the challenge and clicks okay, synapse still returns |
thinking about this again: it doesn't need any more investigation. It just needs an update to the documentation, and an update to the matrix.org deployment (and worker-based modular.im deployments). |
I'm going to do this. |
Does this fix all cases, where auth fallbacks are used? I'd imagine all requests, that use interactive authentification, need to be routed to the same endpoint as the request, that requires auth. For example I believe that the auth fallback for device deletion needs to be routed to the same worker, that handles that request. Or am I missing something like this not being handled by a worker, so it should work fine? |
ohhhhh gosh that's a good point. this is going to be much harder to fix. |
I took another look at what uses the I think the following patterns use it:
The first two on this list are now documented, not sure if we just need to document the rest of these or if there's more to do. Just documenting them seems fairly fragile though (we will likely run into this again in the future). |
Yeah, those endpoints match my expectation, of where I know UI auth is used. I think just documenting them is a bit brittle. I can't even find some of them in the doc, so I guess those are handled by the master process? I think it would make the most sense, if all of those could be handled by the client_reader and successive requests from the same client to the client reader were routed to the same instance of the client_reader, but I don't really know where the cut-off for that would be (5 minutes?). I think there should be some way for workers to cross-talk maybe, so that they can continue fallback auth, if needed. Since this only affects requests that contain |
This is where my mind went to as well, especially with the work that @erikjohnston has been doing. |
interim solutions to this could be:
|
Somewhat related, #649 (comment) notes that UI auth sessions get dropped over restarts. |
In addition to #6705 (comment) we could attempt to solve this by persisting the data more permanently:
|
sticking it in the db sounds good |
Fixed by #7302. |
For the record, no, none of riot-ios/riot-andriod/riotX use fallback auth for recaptcha. |
Description
So I was trying to figure out why the
/auth/xxx/fallback/web
was working on a local homeserver instance but not on matrix.org.In this flow, there's a
sessions
dict which governs the current state of your login/registration progress. When you complete a auth stage, your session in this dict is modified. Thissessions
dict is available to registration and login methods.Turns out that in the recommended worker setup, you can end up with two workers, each with their own instance of
sessions
. One tracks your login progress, and another that gets modified when you successfully complete web fallback. However, because they are separate, you don't actually see any progress when you query/register
after successfully completing web fallback registration stages.Essentially
/auth/xxx/fallback/web
needs to get routed to the same worker as/register
.Synapse v1.8.0
The text was updated successfully, but these errors were encountered: