FR: TOTP 2FA for internal auth #2544

Open
opened 2026-11-16 09:46:18 +00:00 by CinnamonLambda · 1 comment

What new feature do you want to see? What problem does it solve?

It would be really helpful for c10y users to be able to set up a 2FA mechanism for their accounts. Homeservers can already achieve this by delegating auth to an OIDC provider, but for smaller homeservers this adds a lot of additional complexity just to improve account security, in cases where the homeserver is too small to otherwise justify an OIDC setup. Users with 2FA set up would not be able to log in via UIA.

Further reading

No response

Additional context

What I'd really like to do is reduce how susceptible users are to casual password guessing. Another possible way to do this, if integrated 2FA is considered a bit much for the internal auth system, might be a way to enforce a minimum password strength.

### What new feature do you want to see? What problem does it solve? It would be really helpful for c10y users to be able to set up a 2FA mechanism for their accounts. Homeservers can already achieve this by delegating auth to an OIDC provider, but for smaller homeservers this adds a lot of additional complexity just to improve account security, in cases where the homeserver is too small to otherwise justify an OIDC setup. Users with 2FA set up would not be able to log in via UIA. ### Further reading _No response_ ### Additional context What I'd really like to do is reduce how susceptible users are to casual password guessing. Another possible way to do this, if integrated 2FA is considered a bit much for the internal auth system, might be a way to enforce a minimum password strength.
Owner

The issue with adding native support for anything more than username+password is that we can't offer those options to people running in hybrid oauth compatibility mode, because Matrix's UIA authentication (the challenge/response mechanism predating OAuth) doesn't have support for arbitrary flow stages, nor any sort of two-factor auth. This is the same reason we can't really implement support for passkeys or other common goodies like that. Supporting additional security factors or auth methods would require servers switch to "exclusive" oauth compatibility mode, however ecosystem support for oauth - while growing - is still pretty lacklustre. Plus, switching to exclusive post-factum will break any legacy auth sessions, possibly in such a way that the user can never log in again (e.g. can't reset password or initiate a crypto key backup because UIA is now disabled).

I think the broad consensus from the maintainer team is that we'd love to implement extra stuff like this, but doing so will end up presenting a confusing and unintuitive UX. Ideally, legacy auth needs deprecating in the specification (it's not currently!) so that we can even remotely justify easing out support for it, but such a spec proposal would likely be fiercely contested and we don't have time to play the bureaucracy game long enough to see it through.

I think I've summarised the team's thoughts here but @ginger may have more to say, not sure

The issue with adding native support for anything more than username+password is that we can't offer those options to people running in [hybrid oauth compatibility mode](https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/92f9531defd7ef7e6b58966682a01728891c62d5/conduwuit-example.toml#L2514-L2524), because Matrix's UIA authentication (the challenge/response mechanism predating OAuth) doesn't have support for arbitrary flow stages, nor any sort of two-factor auth. This is the same reason we can't really implement support for passkeys or other common goodies like that. Supporting additional security factors or auth methods would require servers switch to "exclusive" oauth compatibility mode, however ecosystem support for oauth - while growing - is still pretty lacklustre. Plus, switching to exclusive post-factum will break any legacy auth sessions, possibly in such a way that the user can never log in again (e.g. can't reset password or initiate a crypto key backup because UIA is now disabled). I think the broad consensus from the maintainer team is that we'd love to implement extra stuff like this, but doing so will end up presenting a confusing and unintuitive UX. Ideally, legacy auth needs deprecating in the specification (it's not currently!) so that we can even remotely justify easing out support for it, but such a spec proposal would likely be fiercely contested and we don't have time to play the bureaucracy game long enough to see it through. I think I've summarised the team's thoughts here but @ginger may have more to say, not sure
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
continuwuation/continuwuity#2544
No description provided.