# devise-two-factor/devise-two-factor

Barebones two-factor authentication with Devise

Repository: https://github.com/devise-two-factor/devise-two-factor
Canonical: https://ross.abutalabs.com/products/devise-two-factor
Language: Ruby
License: MIT
License Family: permissive
Last push: 2026-06-22T01:02:35+00:00

## Health v2 (maintenance only)
Score: 72/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 88, release rhythm 36, longevity 100
- inputs: {"age_days": 4496, "days_push": 73, "days_rel": 212, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1308, forks 261 (observed 2026-08-28T04:04:19.138110+00:00)

## What it is
A minimalist Ruby gem extending Devise with two-factor authentication via TOTP. It integrates with authenticator apps like Google Authenticator and Authy and supports encrypted secrets and backup codes.

## Use cases
- add two-factor authentication to a Rails app
- enable TOTP login for Devise users
- support Google Authenticator or Authy in my app
- add backup codes for 2FA
- secure user accounts with time-based one-time passwords

## When to choose
- you already use Devise in a Rails application
- you want a simple, security-focused TOTP implementation
- you need encrypted 2FA secrets via ActiveRecord encryption

## When to avoid
- your app does not use Devise
- you need SMS or email-based 2FA rather than TOTP
- you are not on Rails

## Facets
- artifact type: library
- maturity: active
- function: auth, security
- domain: security, web-development, backend
- platform: ruby
- tags: totp, two-factor-authentication, devise, rails, backup-codes, otp, web-server

## Member repositories
- devise-two-factor/devise-two-factor (main) score 72

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:19.138110+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-30T04:50:04.766967+00:00, confidence not recorded.
  - readme: https://github.com/devise-two-factor/devise-two-factor (fetched 2026-08-28T04:04:19.138110+00:00, sha bd11cf921ba8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
