# 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:** 14

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [2018 年 1 月 8 日午前 4:10 UTC](https://meta.discourse.org/t/two-factor-local-login-proposal/76689/14 "2018-01-08T04:10:32Z")

</div>

Remember to have an admin escape hatch to remove 2FA from the account, because you’re going to get people who didn’t set up enough backups. I suggest strong wording along the lines of “Please make **extra sure** this request is actually from the person who owns the account!”

You could even have an email notification “2FA Removal Requested” and mandatory time delay + cancel link, but that does feel like it might be overkill?

On a technical note, I think there’s value in having a single `second_factor_data` table containing all the methods registered to accounts, instead of spreading it out over multiple tables - that way, making the management UI for removing and **auditing** your 2FA methods only needs a single query.

| user\_id | method | created\_at | last\_used | data |
| --- | --- | --- | --- | --- |
| 208 | totp | 2018-01-10 … | 2018-01-11 … | 9bJGDVffCc6G58Epr1xJ |
| 208 | recovery | 2018-01-10 … | NULL | JFMYBZCVZ8 |
| 208 | recovery | 2018-01-10 … | NULL | VJND3AECEH |
| 208 | recovery | 2018-01-10 … | NULL | D4KL2WYZYL |
| 208 | recovery | 2018-01-10 … | NULL | R6AYTHTIHO |
| 208 | u2f | 2018-01-12 … | 2018-01-12 … | {“version”:“U2F-V2”,“keyHandle”:“d7AIn-S2cx7n2GgttorX\_w”, “publicKey”:“MIIDnzCCAoegAwI…”} |
| 136 | webauthn-tpm | 2018-01-07 … | 2018-01-12 … | {“publicKey”:“MIIDnzCCAoegAwI…”, …} |
| 136 | recovery | 2018-01-07 … | NULL | VTXFPJJGWE |

I had a little bit written about plugins adding extra methods, but there isn’t really anything mature other than U2F right now.

---

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