# 要求员工启用双因素认证

**URL:** https://meta.discourse.org/t/requiring-2fa-for-staff/94868
**Category:** Feature
**Created:** [2018年八月16日 11:42 UTC](https://meta.discourse.org/t/requiring-2fa-for-staff/94868 "2018-08-16T11:42:07Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![nibl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nibl/32/119684_2.png) [@nibl](https://meta.discourse.org/u/nibl)
#### Post date: [2018年八月16日 11:42 UTC](https://meta.discourse.org/t/requiring-2fa-for-staff/94868/1 "2018-08-16T11:42:07Z")

</div>

Is there a way to require moderators and admins to use two factor authentication?

I thought there was a setting, but cannot find it in the current version.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [2018年八月16日 13:18 UTC](https://meta.discourse.org/t/requiring-2fa-for-staff/94868/2 "2018-08-16T13:18:51Z")

</div>

I don’t think such a setting exists!  
But it may exist in future.

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [2018年八月16日 14:54 UTC](https://meta.discourse.org/t/requiring-2fa-for-staff/94868/3 "2018-08-16T14:54:23Z")

</div>

No, you can’t require it but you can easily see who enabled 2FA from `/admin/users/list/staff`:

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/3/f3a11676c39e6934007028403bc945b77af0f87e.png)

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2018年八月17日 22:01 UTC](https://meta.discourse.org/t/requiring-2fa-for-staff/94868/4 "2018-08-17T22:01:29Z")

</div>

将此话题移至 #contribute:feature。我最近在我们的 Mattermost 服务器上启用了强制 2FA，效果非常好。我认为我们可以借鉴类似流程在 Discourse 中实现这一功能：

1. 管理员启用站点设置 `enforce 2FA` : `staff`
2. 如果其他工作人员已登录且已配置 2FA，则无需任何操作。
3. 如果其他工作人员已登录但未配置 2FA，则将其重定向到 2FA 配置页面。在配置 2FA 之前，用户无法进行其他任何操作（除了注销）。
4. 如果其他工作人员已注销，则在下次登录时立即将其重定向到 2FA 配置页面。在配置 2FA 之前，用户无法进行其他任何操作（除了注销）。

站点设置的其他有效选项包括 `none`、`admins` 和 `all`。我认为在大多数情况下（尤其是公开论坛），启用 `all` 有些大材小用，但我认为这对内部站点来说是一个优势。

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2018年八月27日 20:09 UTC](https://meta.discourse.org/t/requiring-2fa-for-staff/94868/17 "2018-08-27T20:09:15Z")

</div>

Thanks again for the suggestion @nibl. This is now on the list to be included in [Discourse Version 2.3](https://meta.discourse.org/t/discourse-version-2-3/96690) _(list always subject to change)_.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2019年十月26日 15:30 UTC](https://meta.discourse.org/t/requiring-2fa-for-staff/94868/18 "2019-10-26T15:30:36Z")

</div>

This was added in March 2019.  
[https://review.discourse.org/t/feature-enforce-two-factor-authentication-6348/2198](https://review.discourse.org/t/feature-enforce-two-factor-authentication-6348/2198)

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2019年十月26日 15:30 UTC](https://meta.discourse.org/t/requiring-2fa-for-staff/94868/19 "2019-10-26T15:30:39Z")

</div>


