# Two Factor local login proposal

**URL:** <https://meta.discourse.org/t/two-factor-local-login-proposal/76689>\
**Category:** Feature\
**Created:** [2017 年 12 月 24 日午前 7:17 UTC](https://meta.discourse.org/t/two-factor-local-login-proposal/76689 "2017-12-24T07:17:59Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017 年 12 月 27 日午前 6:56 UTC](https://meta.discourse.org/t/two-factor-local-login-proposal/76689/5 "2017-12-27T06:56:44Z")

</div>

> [@awole20](#):
>
> If a user disables and re-enables a key, I’m thinking of regenerating the key. This allows a 2-factor “reset” in the event of a stolen key. However, any authenticator would have to be re-set up, which could be a pain if you have multiple devices/apps that you would like to set up with the authenticator.

I would say, if you enabled 2fa and then click “disable”, **you must** enter a token to actually disable it.

> [@awole20](#):
>
> I really like the idea of being able to generate some kind of backup key codes, in the even that you are parted with your authenticator app somehow, or perhaps gets disabled when a user resets a password. The latter would follow the general Discourse account handling that “if you have access to the email, you have access to Discourse”.

I would hold on this to v2, I like the idea of backup codes but would like to live with this first

> [@awole20](#):
>
> As a first step, I’m looking to tackle the basic flow described above to get Discourse working with Google Authenticator, and expand out from there. I’m looking at adding the gems active\_model\_otp for the code generation + checking, and rqrcode for processing QR codes.

Looks like a good plan, I would prefer only to add the [GitHub - mdp/rotp: Ruby One Time Password library · GitHub](https://github.com/mdp/rotp) dependency cause I dont want some gem deciding how our models should look and how we implement stuff. The rotp gem is going to be a much safer and easier to audit dependency.

* * *

I would also ensure that admins/moderators can “disable” 2fa for other users (except for themselves) via the admin screens.

I do wonder if we should add a link of “I lost my phone / uninstalled app” on the "enter your otp page, but it can possibly wait for now.

---

_[View the full topic](https://meta.discourse.org/t/two-factor-local-login-proposal/76689)._
