Two-Factor Authentication Login (m.login.2fa.totp flow) #1997
Labels
client-server
Client-Server API
improvement
A suggestion for a relatively simple improvement to the protocol
At the moment, there isn't a standard (or non-standard) way for a user to have TOTP-style two-factor authentication on their account. This means that users are only protected by their passphrase (which could be weak) and makes them susceptible to keyloggers as well as rogue apps being able to re-authenticate even after the user decides to forcefully kill the device. The vast majority of web services these days support 2FA in the form of RFC 6238 TOTP Tokens.
Because login flows are designed to allow multiple stages, adding support for 2FA should only require:
m.login.2fa.totp
flow which takes an RFC 6238 TOTP Token using a pre-configured seed.POST /_matrix/client/r0/account/two-factor/totp
(or similar) for setting up the pre-configured seed.We also need a recovery code system:
m.login.2fa.recovery
as a fallback recovery-code system (these recovery codes would be re-generated each time you reconfigured 2FA).POST /_matrix/client/r0/account/two-factor/recovery
to allow manual re-generation of the recovery codes. Old recovery codes are invalidated.I use the term "2FA" here, but really Matrix supports multi-factor authentication so you could see future extensions that would allow a server to require both a TOTP token and some other token to log in.
The text was updated successfully, but these errors were encountered: