Skip to content
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

Two-Factor Authentication Login (m.login.2fa.totp flow) #1997

Closed
4 tasks
cyphar opened this issue May 14, 2019 · 3 comments
Closed
4 tasks

Two-Factor Authentication Login (m.login.2fa.totp flow) #1997

cyphar opened this issue May 14, 2019 · 3 comments
Labels
client-server Client-Server API improvement A suggestion for a relatively simple improvement to the protocol

Comments

@cyphar
Copy link

cyphar commented May 14, 2019

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:

  • Define a m.login.2fa.totp flow which takes an RFC 6238 TOTP Token using a pre-configured seed.
  • Define POST /_matrix/client/r0/account/two-factor/totp (or similar) for setting up the pre-configured seed.

We also need a recovery code system:

  • Define m.login.2fa.recovery as a fallback recovery-code system (these recovery codes would be re-generated each time you reconfigured 2FA).
  • Define 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.

@turt2live
Copy link
Member

This looks like a great foundation for a proposal - is it possible to get it written up in PR form as per https://matrix.org/docs/spec/proposals ?

@cyphar
Copy link
Author

cyphar commented May 14, 2019

Yup, I was going to take a crack at it. 😉

@turt2live turt2live added client-server Client-Server API improvement A suggestion for a relatively simple improvement to the protocol labels May 14, 2019
@cyphar
Copy link
Author

cyphar commented May 14, 2019

#1998.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-server Client-Server API improvement A suggestion for a relatively simple improvement to the protocol
Projects
None yet
Development

No branches or pull requests

2 participants