# RobThree/TwoFactorAuth

PHP library for Two Factor Authentication (TFA / 2FA)

Repository: https://github.com/RobThree/TwoFactorAuth
Canonical: https://ross.abutalabs.com/products/robthree-twofactorauth
Language: PHP
License: MIT
License Family: permissive
Topics: qrcode, php, two-factor, twofactorauth, totp, multi-factor, security
Last push: 2026-01-05T15:36:39+00:00

## Health v2 (maintenance only)
Score: 58/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 60, release rhythm 32, longevity 100
- inputs: {"age_days": 4367, "days_push": 240, "days_rel": 240, "gap_med": 218.5, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1186, forks 143 (observed 2026-08-28T04:03:55.116804+00:00)

## What it is
A PHP library for implementing two-factor (multi-factor) authentication using TOTP time-based one-time passwords and QR codes. It supports multiple QR code providers and optional NTP time synchronization, installable via Composer.

## Use cases
- add 2fa to a php web app
- generate totp secrets and qr codes in php
- verify google authenticator codes in php
- implement multi-factor authentication with php
- totp one-time password verification library

## When to choose
- you need standards-compliant TOTP 2FA in a PHP 8.2+ project
- you want flexible QR code generation options
- you need a well-tested, MIT-licensed alternative to PHPGangsta/GoogleAuthenticator

## When to avoid
- your project runs PHP older than 8.2
- you need non-TOTP methods like SMS or push-based 2FA
- you are not working in PHP

## Facets
- artifact type: library
- maturity: stable
- function: auth, security
- domain: security, web-development, backend
- platform: php
- tags: totp, two-factor-authentication, qrcode, multi-factor, google-authenticator-compatible

## Member repositories
- RobThree/TwoFactorAuth (main) score 58

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:55.116804+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:23:47.371201+00:00, confidence not recorded.
  - readme: https://github.com/RobThree/TwoFactorAuth (fetched 2026-08-28T04:03:55.116804+00:00, sha dada71d4442f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
