Tap-to-approve two-factor for WordPress
The DollarMates U2 Secured Authenticator plugin challenges every interactive WordPress login. The password is checked as normal, and then the session is held until the user approves it on their phone.
How a login works
- 1WordPress validates the password and fires wp_login — which, following the Two Factor feature-plugin pattern, fires after WordPress has already set the auth cookie.
- 2The plugin clears that cookie again immediately. The password was right, but the session is not earned yet.
- 3It requests a push approval from U2 Secured and renders an interim challenge screen in place of the usual post-login redirect, showing a number to match in the app.
- 4The browser polls for the outcome while the user taps the matching number on their phone and confirms it. The request expires after about 120 seconds — tight if anything interrupts the user, such as the app asking for a permission on its first run — and an expired request means signing in again rather than anything worse.
- 5On approval the plugin re-issues the auth cookie and the login completes.
When the phone cannot answer
- TOTP — a standard six-digit authenticator-app code, offered on the challenge screen under “Or enter a code”. It needs PHP’s sodium extension and U2AUTH_ENCRYPTION_KEY; without both, the plugin declines the factor and says so, rather than storing the shared secret unencrypted.
- Recovery codes — ten single-use codes issued when a user links their phone, verified entirely against this site’s own database with no outbound call. This is the factor that still works when U2 Secured is unreachable.
- Fail closed, with no way to opt out. If the API cannot be reached, the challenge screen says so and asks for a recovery code rather than letting the session through. There is no setting that changes this — a session is never admitted with no second factor because a network call failed.
What it does not cover
Two ways into WordPress never reach the hook this plugin challenges on. Both are named here rather than left to be discovered later.
- Application passwords sign in without the second factor, by design. They are a legitimate WordPress feature with real uses, so instead of being silently broken they are surfaced as an admin notice to any user who has one. Revoke the ones you do not need.
- XML-RPC is refused, not challenged. It authenticates with the raw password and never reaches wp_login, so for an account that uses two-factor the plugin returns an error instead of a session. Anything that signs in over XML-RPC for those accounts — some mobile apps and older publishing tools — stops working.
Learn this here, not from a breach
Those two are the whole of the gap, and an operator who assumes otherwise is less protected than they think. Everything that reaches an interactive login is challenged; these two do not.
What you’ll need
- WordPress 6.0 or later, on PHP 7.4 or later.
- A U2 Secured application and its server API key (rka_…) — create one under Dashboard → your app → API Keys.
- Each user’s own phone, with the U2 Secured Authenticator app. Linking cannot be done on someone else’s behalf.
- PHP’s sodium extension, if you want the TOTP fallback. It ships enabled by default on PHP 7.2+.