Multi-Factor Authentication

MFA that's tougher than a fourteener. Two-factor authentication your users will actually enable.

89%
User Adoption Rate
Zero
Account Takeovers
< 50ms
Code Verification
10 Seconds
Setup Time

Features That Actually Matter

Built for security-conscious organizations that value user experience

TOTP Support

Works with Google Authenticator, Authy, 1Password, and any TOTP-compatible app.

  • Universal app compatibility
  • RFC 6238 compliant
  • 30-second time windows

Backup Codes

10 single-use recovery codes for when devices are lost or unavailable.

  • Cryptographically secure
  • One-time use only
  • Automatic regeneration

QR Code Setup

One scan and done. Easier than finding parking downtown on a Saturday.

  • Instant setup process
  • Custom QR branding
  • Fallback manual entry

Grace Period Login

Users get a heads up before MFA enforcement. We're not monsters.

  • Configurable grace period
  • Friendly reminders
  • Gradual enforcement

Smart Detection

Automatically prompts for MFA on suspicious logins and new devices.

  • Anomaly detection
  • Device fingerprinting
  • Geo-location analysis

API-First Design

Every feature available via API, not just the UI.

  • RESTful endpoints
  • Webhook notifications
  • Batch operations

Implementation That Won't Ruin Your Weekend

Get MFA working in your app with these simple examples

1

MFA Setup (5 minutes)

// Setup MFA for user
const setupMFA = async () => {{
  const {{ qrCode, secret, backupCodes }} = 
    await api.post('/users/mfa/setup');
  
  // Show QR code to user
  displayQRCode(qrCode);
  
  // Show backup codes (we handle the UI)
  showBackupCodes(backupCodes);
  
  // Wait for user to scan and enter code
  const verificationCode = await getUserInput();
  
  // Enable MFA
  const result = await api.post('/users/mfa/enable', {{
    code: verificationCode
  }});
  
  if (result.success) {{
    celebrate(); // 🎉
  }}
}};
2

MFA Verification (2 minutes)

// Enhanced login with MFA
const login = async (credentials) => {{
  const loginResult = await api.post('/auth/sign_in', {{
    email: credentials.email,
    password: credentials.password
  }});
  
  if (loginResult.requires_mfa) {{
    // Prompt for MFA code
    const mfaCode = await promptForMFA();
    
    const mfaResult = await api.post('/auth/verify_mfa', {{
      session_token: loginResult.session_token,
      mfa_code: mfaCode
    }});
    
    return mfaResult.access_token;
  }}
  
  return loginResult.access_token;
}};
⚛️

React Hook

// Using our React hook
import {{ useMFA }} from '23blocks-react';

function MFASetup() {{
  const {{ 
    setupMFA, 
    enableMFA, 
    qrCode, 
    backupCodes,
    isLoading 
  }} = useMFA();
  
  const handleSetup = async () => {{
    await setupMFA();
    // QR code and backup codes are now available
  }};
  
  const handleEnable = async (code) => {{
    await enableMFA(code);
    router.push('/dashboard');
  }};
  
  return (
    &lt;MFASetupFlow 
      onSetup={{ '{' + '{' }}handleSetup{{ '}' + '}' }}
      onEnable={{ '{' + '{' }}handleEnable{{ '}' + '}' }}
      qrCode={{ '{' + '{' }}qrCode{{ '}' + '}' }}
      backupCodes={{ '{' + '{' }}backupCodes{{ '}' + '}' }}
      loading={{ '{' + '{' }}isLoading{{ '}' + '}' }}
    /&gt;
  );
}}
API

Status & Management

// Check MFA status and manage
const mfaStatus = await api.get('/users/mfa/status');
console.log(mfaStatus);
// {{
//   enabled: true,
//   backup_codes_remaining: 7,
//   last_used: '2024-01-15T10:30:00Z',
//   trusted_devices: 2
// }}

// Disable MFA (with confirmation)
await api.post('/users/mfa/disable', {{
  confirmation_code: '123456'
}});

// Regenerate backup codes
const newCodes = await api.post('/users/mfa/regenerate_codes');

// Check if code is valid (without consuming it)
const isValid = await api.post('/users/mfa/validate', {{
  code: '123456'
}});

Real-World Results

Numbers that matter from companies using our MFA

Boulder Bike Share

Urban Mobility Platform

89%
User adoption rate within 30 days
Zero
Account takeovers since implementation
67%
Reduction in "suspicious login" support tickets

TrailTracker

Outdoor Recreation App

3 Months
Development time saved vs. building in-house
0
Security audit findings after implementation
Restored
Developer sanity levels

Perfect For Teams Who...

Common scenarios where MFA makes the biggest impact

Enterprise Security Requirements

Companies that need to meet strict security compliance standards.

  • FIPS compliant for government contractors
  • SOC 2 Type II compliance requirements
  • Insurance policy requirements for cyber coverage

High-Value User Accounts

Protecting accounts with access to sensitive data or financial information.

  • Admin accounts with elevated privileges
  • Financial applications and payment processing
  • Healthcare applications with PHI access

Developer-Focused Organizations

Teams that value their weekends and want security that "just works".

  • Startups moving fast with limited security resources
  • Development teams focused on core product features
  • Companies with excellent documentation standards

User Experience Focused

Companies that care about security but refuse to frustrate users.

  • Consumer applications with high engagement requirements
  • Mobile-first applications with frequent usage
  • Platforms with non-technical user bases

Technical Documentation

Everything you need to implement and maintain MFA

MFA API Reference

Complete API documentation with request/response examples for all MFA endpoints

View MFA API Docs →

Integration Guide

Step-by-step integration tutorials for React, Vue, Angular, and vanilla JavaScript

View Integration Guide →

Quick Start

Get MFA working in your app in 10 minutes with our quick start guide

Get Started →

Ready to Secure Your App Like a Pro?

Stop losing sleep over password breaches. Start protecting your users with MFA that actually works.

Stay in the loop

Get product updates, engineering posts, and new block announcements delivered to your inbox.

No spam. Unsubscribe anytime. Privacy policy.