| 开发者 |
rebelcode
jeangalea |
|---|---|
| 更新时间 | 2026年8月6日 01:24 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPL-3.0-or-later |
| 版权网址: | 版权信息 |
[sigil_2fa] on any page and users can set up and manage their methods there. Sites that keep members out of wp-admin need this, and enforcement redirects to that page when it exists instead of to an admin screen the user cannot open.
Multisite
Accounts are network-wide in WordPress, so second factors are too. An authenticator or backup codes cover every site on the network, the policy is set once under Network Admin, and the rate limiter counts across the network rather than per site. On a network, resetting another user's 2FA is a Network Admin action, which is how WordPress governs user editing there.
Passkeys are bound to the domain they were created for, so by default a passkey covers the site it was registered on. A network under one operator can widen that to cover every subdomain site with the sigil_rp_id filter. It is opt-in because widening lets any site under that domain request assertions, which matters when sites have different administrators.
REST API
Routes under sigil/v1 read a user's methods, reset or remove them, read and edit the policy, and describe or complete a pending login challenge so a decoupled front end can run the second step itself. The challenge routes are authenticated by the challenge token issued after the password step. Reading and changing anything else requires the same capability as the equivalent screen.
This does not add a second factor to token authentication. A request that authenticates with an application password never reaches the interactive login, so it is not challenged.
Recovery
Three ways back in if a second factor is lost:
edit_users capability can reset another user's 2FA from the Users screen.wp sigil reset <user> clears a user's second factor from the command line when no one can reach the dashboard./wp-content/plugins/sigil-2fa/.[sigil_2fa] and they can enrol there.Use one of the backup codes shown when you first set up 2FA. If you did not keep those, another administrator can reset your account from the Users screen. If nobody can get in at all, anyone with server access runs wp sigil reset <your-username> and your second factor is cleared.
No. All authentication happens on your own site. The plugin does not contact any external service and does not require an account.
Application passwords bypass 2FA by design, as that is how WordPress authenticates automated requests. The settings screen documents this, and application passwords can be disabled per role to close that path.
Passkeys need PHP 8.0 or newer. On older PHP the plugin still runs and offers authenticator apps, backup codes, and email; only the passkey method is hidden.
Yes. The policy is set once for the network under Network Admin → Settings → Sigil, and a user's authenticator or backup codes work on every site because WordPress accounts are network-wide. Passkeys are bound to the domain they were created for, so each site gets its own unless you widen that with the sigil_rp_id filter.
Yes. Put [sigil_2fa] on a page. Users manage their methods from there, and anyone required to enrol is sent to that page rather than to the dashboard.
Yes. Settings → Sigil lets you pick exactly which roles are required, and set a grace period so people are prompted to enrol rather than locked out immediately.
sigil_challenge_text for the wording of the two-factor screen, and sigil_manage_capability for which capability reaches the settings. Values are escaped after filtering, and the capability filter only narrows, never widens.[sigil_2fa] shortcode, for sites whose users have no dashboard access. Enforcement sends people there when the page exists.sigil/v1 for reading 2FA state, managing methods, editing the policy, and completing a login challenge from a decoupled front end.sigil-2fa and the WP-CLI command is wp sigil.