TOTP 2-factor authentication (TfaTotp)

TOTP standards for “Time-based One-Time Password”, which is an algorithm that computes a one-time password. It does this with a shared secret key and the current time.

TOTP is implemented by many mobile authenticator applications, and thus widely available and in widespread use. TOTP is supported by all of these authenticator applications (and likely others), which you can use with ProcessWire:

  • Google Authenticator (Android, iOS)
  • Microsoft Authenticator (Android, iOS)
  • 1Password (Android, iOS, Windows, Mac)
  • Authy (Android, iOS, Windows, Mac, cloud-sync)
  • LastPass Authenticator (Android, iOS, Windows, Mac, Linux, cloud-sync)

One of the nice things about TOTP is that all the applications implement the same algorithm (described in RFC 6238), and thus there is likely to be broad compatibility between them.

TOTP relies upon a long string of characters called a "secret", which is a private key that is stored server-side with the user account when enabling two-factor auth. When you use your phone and authenticator app to scan a QR code, it is sharing that secret with your phone. From that point forward, the website and phone can confirm identity with a 6-digit code that changes every 30 seconds.

What if your phone dies or gets lost? Since the private key (secret) is stored on your phone, you'd no longer have the ability to generate authentication codes. So this could be a problem, unless you've got a backup of your private key. Applications like Authy and LastPass keep that backup for you (cloud-sync). If you are using another application like Google Authenticator, you could always keep your own backup of the QR code/secret, so that you could plug it into any other phone or authentication app and continue to generate codes with it. But if you were to do that, you'd want to do so very securely, as the more copies of that secret that there are, the less secure it is.

To use TOTP two-factor authentication in ProcessWire, you must be running version 3.0.109 or newer, and you must install the TfaTotp module (link below).

Latest news

  • ProcessWire Weekly #523
    In the 523rd issue of ProcessWire Weekly we'll check out what's new in the core this week, share some new module related news, and more. Read on!
    Weekly.pw / 18 May 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits