Skip to main content

Magical Auth Architecture

Understanding the technical architecture behind Magical Auth.

System Components

Magical Auth involves multiple parties working together to securely verify phone numbers without SMS:

Direct Verification
Your Infrastructure

User's Device

Mobile / Desktop Browser

Your Client App

Web / Mobile Application

Your Backend Server

Application Server

HTTPS
Glide Infrastructure

Glide Magical Auth

Identity Verification Service

Carrier API
Carrier Infrastructure

Mobile Carrier Networks

Cellular Network Providers

⚡️ Note: Client App also verifies directly with Carriers

Component Details

User's Device

The physical device containing the SIM card. This is where the cryptographic proof of phone ownership originates.

AspectDescription
What it doesContains the SIM card and provides cryptographic proof of phone number ownership
Key capabilityAccesses SIM credentials via OS-level APIs (Digital Credentials API on Android, App Clips on iOS)
Data providedEncrypted credential token signed by the carrier

Your Client App

Your web or mobile application that initiates the authentication flow.

AspectDescription
What it doesIntegrates Glide's Web Client SDK to trigger the secure prompt
Key responsibilityCalls prepare() and invokeSecurePrompt()
Never handlesRaw phone numbers or carrier credentials directly

Your Backend Server

Your server-side application that communicates with Glide's API.

AspectDescription
What it doesHolds your API key, calls Glide's prepare/process endpoints
Key responsibilityReceives verified phone numbers and makes business decisions
Providesconsent_data for privacy compliance, client_info for strategy selection

Glide Magical Auth Server

Glide's authentication aggregator that orchestrates the verification flow.

AspectDescription
What it doesSelects optimal authentication strategy, manages sessions, validates credentials
Key responsibilityTranslates between your API and carrier-specific protocols
Privacy guaranteeNever stores phone numbers; processes in memory only

Mobile Carrier Networks

The telecommunications providers that own the phone numbers.

AspectDescription
What it doesProvides the authoritative verification of phone number ownership
Key capabilityValidates SIM credentials against their subscriber database
ReturnsCryptographically signed verification result

Authentication Flow Overview

The flow consists of three main steps that happen in sequence:

Step 1: PREPARE

Your Backend

Glide API

Returns Data

Session ID +
Strategy Data
Step 2: INVOKE

Your Client App

Browser / OS

Returns Credential

From Device
(SIM/Carrier)
Step 3: PROCESS

Your Backend

Glide API

Verification Result

Phone Number +
Success Status

Detailed Sequence Diagram

The following diagram shows the complete flow for phone number verification:

Supported Authentication Strategies

Glide automatically selects the best strategy based on the user's device, carrier, and platform:

TS43 Strategy

AspectDetails
PlatformsAndroid (Google Play Services 24.0+), Chrome-based browsers (v141+)
User ExperienceOS-level bottom sheet prompts user to approve consent & verification
How it worksDigital Credentials API accesses SIM credentials via Credential Manager

Technical Details:

  • Uses Android's Jetpack Credential Manager library
  • Web browsers use the W3C Digital Credentials API
  • Credential is an SD-JWT signed by the carrier
  • Works over any internet connection (WiFi, cellular, etc.)

Desktop Strategy (QR Code)

AspectDetails
Supported ScenariosDesktop browsers without SIM access
PlatformsAny desktop browser
User ExperienceScan QR code with mobile phone to verify
How it worksCross-device authentication via mobile companion

Technical Details:

  • Desktop shows QR code with session information
  • Mobile device scans and completes TS43 or Link flow
  • Visual challenge pattern prevents phishing attacks

Data Flow Summary

StepFromToData
1Your BackendGlide APIphone_number, use_case, consent_data, client_info
2Glide APIYour Backendsession, authentication_strategy, data
3Your ClientUser's BrowserStrategy-specific prompt data
4User's DeviceYour ClientEncrypted credential token
5Your BackendGlide APIsession, credential
6Glide APICarrierCredential validation request
7CarrierGlide APIVerified phone number
8Glide APIYour Backendphone_number, verified status

The SDK provides both a high-level authenticate() method and a granular step-by-step API. The granular approach is recommended for production.

Call prepare() early to determine upfront if Magical Auth is available for this user, or if you should use your OTP fallback.

// 1. Call prepare() early - as soon as you have the phone number
try {
prepareResponse = await client.prepare({
use_case: USE_CASE.VERIFY_PHONE_NUMBER,
phone_number: '+14155551234'
});
// Magical Auth available - show instant verify button
} catch (error) {
// Not eligible - show OTP fallback instead
}

// 2. When user clicks, invoke browser prompt (instant)
const invokeResult = await client.invokeSecurePrompt(prepareResponse);
const credential = await invokeResult.credential;

// 3. Complete verification
const result = await client.verifyPhoneNumber(credential, prepareResponse.session);
High-Level (authenticate())Granular (prepare()invoke()process())
Great for demos and testing Recommended for production
Single function call Full control over each step
User waits during eligibility check Know eligibility before user clicks
Can't show fallback upfront Graceful fallback to OTP if not eligible

Security Features

  • End-to-end encryption - All data encrypted in transit using TLS 1.3
  • Carrier signatures - Credentials cryptographically signed by carriers using ECDSA
  • No phone storage - Phone numbers never stored on Glide servers; processed in memory only
  • Session isolation - Each verification uses a unique session with cryptographic nonce
  • Short-lived tokens - All credentials and sessions expire within minutes

Learn More