Migrating from Auth0 to Gate
This page covers migrating an existing Auth0 deployment to Gate. The mapping is mechanically straightforward in most cases — Auth0's auth surface and Gate's auth surface cover the same conceptual primitives (tokens, sign-in methods, identity providers, MFA, sessions, transactional email) — but the API shapes differ enough that the migration is a deliberate code change, not a config swap.
If you haven't already, read the migration overview for the four-phase migration arc (capability audit → parallel-run setup → user-data migration → cutover) that applies across all vendors.
1. Capability mapping
| Capability | Auth0 | Gate |
|---|---|---|
| Email + password sign-in | Universal Login / Database Connections | gate.signIn({ email, password }) |
| Magic link | Passwordless connections (email channel; link send_type) | gate.passwordless.requestMagicLink → gate.passwordless.verifyMagicLink |
| OTP | Passwordless connections (email channel; code send_type) | gate.passwordless.requestOtp → gate.passwordless.verifyOtp |
| Social OAuth | Social Connections (Google, GitHub, Microsoft, etc.) | gate.signInWithProvider({ provider: 'google' }) → gate.completeSignIn() |
| SAML / OIDC federation | Enterprise OIDC or SAML Connection | gate.signInWithProvider({ provider: 'saml' }) |
| AD / LDAP | Enterprise AD/LDAP Connection (via Auth0 AD/LDAP Connector) | Federate via gate.signInWithProvider({ provider: 'saml' }) (AD/LDAP fronted by an enterprise IdP via SAML) |
| Passkeys / WebAuthn | Passkeys (early-2024 GA) | See API → Auth §6 |
| MFA — TOTP | MFA Enrollment Policies | End-user TOTP enrollment: POST /@<projectSlug>/gate/mfa/totp/enroll and .../totp/confirm |
| MFA — SMS | MFA Enrollment Policies (Twilio integration) | Not supported (SIM-swap risk; NIST 800-63B-4 deprecation) |
| Recovery codes | Recovery codes flow | 10 single-use codes mandatory at MFA enrollment |
| JWT issuance | RS256 / HS256 with rotated signing keys | EdDSA (default) or RS256 per project; JWKS at <orgSlug>.api.k9o.io/@<projectSlug>/auth/jwks (response wrapped in the standard { data } envelope) |
| Token TTLs | Configurable per tenant | Access token 30 minutes (5 to 60); sign-out after 30 days of inactivity and a 90-day maximum session length, set per project |
| Refresh tokens | Refresh Token Rotation (configurable) | Rotated: gate.refreshToken returns a new access token and a new refresh token; the old one stops working. See Session lifetime and sign-out |
| Sessions | Session policy per tenant | SessionPolicy { idleTimeoutMins, absoluteTimeoutMins, maxConcurrentSessions } per project |
| Branded hosted UI | Universal Login customization | Gate Studio visual authoring (separate extension) |
| Custom email templates | Email Templates per tenant | Triple-trigger pattern per /api/auth §8; BYO templates via the generate*Link form or platform-hosted with overrides via Gate Studio |
| Rules / Actions | Auth0 Rules (deprecated) / Actions | Webhook subscriptions per Security §2.6 + Maker-Checker policy gates per Control for action-time enforcement |
| MAU-based pricing | Per-MAU tier | 50K MAU on Free; Unlimited on every paid tier; identity not a metered axis on paid tiers |
The single capability Gate does not support is SMS MFA. Customers whose Auth0 MFA enrollment is SMS-dominant should plan a parallel migration path to TOTP / WebAuthn during the transition window — give end users a window to enroll a TOTP factor before SMS-only logins stop working.
2. API-shape mapping
2.1 Sign-in
// Auth0 (auth0-spa-js)
const auth0 = await createAuth0Client({
domain: 'your-tenant.auth0.com',
clientId: 'your-client-id',
});
await auth0.loginWithRedirect();
const claims = await auth0.getIdTokenClaims();
const accessToken = await auth0.getTokenSilently();
// Gate (@k9o/gate)
import { createGateClient } from '@k9o/gate';
const gate = createGateClient({
mode: 'standalone',
baseUrl: 'https://<your-org>.api.k9o.io',
projectSlug: '<your-project>',
});
const { data } = await gate.signIn({
password: '...',
});
const accessToken = data.session.accessToken;
The shape difference: Auth0's SPA SDK manages the redirect-flow lifecycle internally and returns the token via getTokenSilently. Gate's SDK returns the (access token, refresh token) pair directly from the sign-in call; you store and refresh them yourself (or wire the refresh path into your HTTP client interceptor).
For SAML / social federated flows, Gate uses gate.signInWithProvider({ provider, redirectUri }) to redirect the browser to the IdP, then gate.completeSignIn() on the callback page to exchange the returned code for the session ({ accessToken, refreshToken, expiresAt }). provider is one of 'saml' | 'oidc' | 'google' | 'github' | 'microsoft'. The callback handler URL you register with the IdP is your own redirectUri, analogous to Auth0's allowed callback URLs.
2.2 Token verification
Auth0 ships a per-tenant JWKS endpoint (https://your-tenant.auth0.com/.well-known/jwks.json). Gate ships a per-project JWKS endpoint (<orgSlug>.api.k9o.io/@<projectSlug>/auth/jwks). Gate's JWKS response is wrapped in the standard { data: { keys } } envelope, so a stock JWKS client cannot read it as is: use verifyJwt from @k9o/gate, or unwrap data yourself. Update the expected iss and aud claims to match your Gate project's token issuance: for end-user tokens aud is the project id, and iss is the deployment's regional issuer (see API → Auth for the canonical claim shape).
// Before: Auth0 verification
import { createRemoteJWKSet, jwtVerify } from 'jose';
const JWKS = createRemoteJWKSet(new URL('https://your-tenant.auth0.com/.well-known/jwks.json'));
const { payload } = await jwtVerify(token, JWKS, {
issuer: 'https://your-tenant.auth0.com/',
audience: 'your-api-identifier',
});
// After: Gate verification
import { verifyJwt } from '@k9o/gate';
// apiHost = `https://${orgSlug}.api.k9o.io`
// The JWKS response is wrapped in the standard { data: { keys } } envelope, so a stock
// createRemoteJWKSet cannot read it; verifyJwt unwraps it.
const result = await verifyJwt({
token,
jwksUrl: `${apiHost}/@${projectSlug}/auth/jwks`,
allowedAlgorithms: ['EdDSA', 'RS256', 'ES256'],
expectedIssuer: issuer, // the iss claim of your Gate tokens (regional; read it from your tokens)
expectedAudience: projectId, // end-user tokens: aud is the project id
});
if (result.valid) { /* result.claims */ }
Default signing algorithm differs: Auth0 ships RS256 by default; Gate ships EdDSA (Ed25519) by default. Most JWT libraries support both; verify your library's algorithm list includes EdDSA, or configure your Gate project to use RS256 if your library is RS-only.
2.3 Refresh
// Auth0 — handled internally by auth0-spa-js via getTokenSilently
const fresh = await auth0.getTokenSilently();
// Gate — explicit refresh
const { data: next } = await gate.refreshToken({
refreshToken: session.refreshToken,
});
// next.accessToken / next.expiresAt: replace the stored access token;
// the refresh token you hold stays valid
Gate's refresh call returns a new access token and a new refresh token, and the one you sent stops working; send an old one again and the session ends. Store the newest one each time. Store it as carefully as a password: whoever holds it can mint access tokens until it is revoked.
2.4 MFA
// Auth0 — MFA Enrollment via Management API + challenge via /mfa endpoint
await management.guardian.enrollments.create({
user_id: 'auth0|123',
});
// Gate — TOTP enrollment is REST-only (the SDK has no gate.mfa namespace):
// POST /@<projectSlug>/gate/mfa/totp/enroll -> data.factor.{id, secret, uri} (uri is an otpauth:// URI)
// POST /@<projectSlug>/gate/mfa/totp/confirm { factorId, code } -> activates the factor
Gate has no end-user MFA challenge route: enrollment and confirmation are available, a step-up challenge for end users is not. The platform's IRREVERSIBLE_ACTION_GATE policy family per Control checks this claim for MFA-required actions — same shape as Auth0's MFA-gated action enforcement, expressed declaratively in policy rather than imperatively in code.
2.5 Identity providers
Auth0's Connections map onto Gate's real surfaces — there is no single IdentityProvider resource to configure; each connection type uses the surface that actually backs it:
| Auth0 Connection type | Gate equivalent |
|---|---|
| Database | Built-in — gate.signIn({ email, password }); no provider setup |
| Passwordless (email link / OTP) | Built-in — gate.passwordless.*; no provider setup |
| Social OAuth | gate.signInWithProvider({ provider: 'google' | 'github' | 'microsoft' }) |
| Enterprise SAML | gate.signInWithProvider({ provider: 'saml' }); the SAML IdP metadata + ACS is registered in the Console at /admin/auth/providers/saml |
| Enterprise OIDC | Generic OIDC is not supported — federate via 'saml', or use a hosted social provider |
| Enterprise AD/LDAP | Configured as an identity provider with gate.identityProviders.create (idpProvider: 'ldap'; PROJECT_ADMIN+) |
Enterprise IdP setup (SAML metadata, LDAP connection settings) is a Console configuration concern, not an SDK object — configured once per project under Console /admin/auth/providers.
2.6 Custom claims / token augmentation
Auth0 Rules / Actions injected custom claims at token issuance. Gate's equivalent surface is:
- Per-project JSON-policy claims augmentation — the project's JSON policy (per Control) can specify additional claims that the gateway adds to issued JWTs based on the caller's identity, roles, and attributes. The claim authoring lives in the policy graph alongside access control.
- Webhook subscriptions on
auth.session.createdfor asynchronous side-effects (provisioning records, notifying downstream services). Same delivery mechanics as SIEM forwarding.
Inline JavaScript hooks like Auth0 Rules / Actions are not first-class in Gate. Behaviour that must run synchronously at token issuance lives in policy; behaviour that can be asynchronous lives in webhooks or Compute functions triggered on auth events.
3. User-data migration
The migration shape depends on your Auth0 connection mix.
3.1 Database connection (Auth0 stores your passwords)
Auth0 exports user data via the User Import / Export job. Export with password hashes (Auth0 ships them as bcrypt by default in the export). Two import paths into Gate:
| Path | When to use |
|---|---|
| Direct hash import | Bulk import with bcrypt hashes preserved. Gate accepts bcrypt hashes; users authenticate transparently with their existing passwords. The hash format is preserved in the user record; future password changes (or first sign-in if configured) re-hash to Argon2id transparently. |
| Federated migration window | Configure Auth0 as an OIDC provider on Gate during the transition; existing users authenticate via Auth0; on each successful sign-in Gate captures their password (Argon2id-hashed at capture time) and stores it on the Gate-side user record. After the transition window, Auth0 is disconnected; subsequent sign-ins use the Gate-side hash. The window length is your call — typically two to four weeks until 95%+ of active users have signed in at least once. |
3.2 Social / Enterprise connections (Auth0 federates)
No password data to migrate. Re-configure the same providers under Gate; flip the user's identity-provider linkage; the first sign-in through the new Gate path creates / updates the linked-provider record.
3.3 Passwordless connections
No persistent secret to migrate. Re-configure the passwordless flow under Gate; existing users start using magic links / OTPs against Gate from cutover onward.
3.4 State + MFA enrollment migration
| Auth0 attribute | Gate equivalent | Migration note |
|---|---|---|
user_id | User.externalId | Preserve as a reference; Gate issues its own usr_<base62> ID |
email_verified | User.state (verified if true, pending_verification otherwise) | Map at import time |
blocked | User.state = 'locked' | Map at import time |
| MFA enrollment | Re-enrollment required | TOTP secrets and WebAuthn credentials are not exported by Auth0 in a Gate-importable form; users re-enroll on first sign-in during the transition window |
| Last login | User.lastSignInAt | Map at import time (or accept Gate's default of the import timestamp) |
Custom user metadata (user_metadata, app_metadata) | User.metadata (JSON column) | Bulk-map at import time; no schema constraint |
4. Cutover checklist
A typical cutover sequence:
□ 1. Provision Gate project; configure all identity providers
□ 2. Run identity-provider /test endpoints; verify each connects
□ 3. Export Auth0 user data with hashes
□ 4. Import user data into Gate (direct or federated path per §3.1)
□ 5. Stand up parallel sign-in flow against Gate (feature flag a fraction of traffic)
□ 6. Monitor sign-in success rate + MFA challenge completion + token-verification errors
□ 7. Widen the Gate-traffic fraction as confidence grows
□ 8. Flip 100% of sign-in traffic to Gate
□ 9. Monitor for one full session-renewal cycle (refresh-token TTL window — typically 30 days)
□10. Decommission the Auth0 tenant — confirm no in-flight refresh tokens still point at Auth0
Most migrations cut over within two to four weeks of step 1. The federated-migration path (§3.1 second row) extends the timeline by the transition window but requires no password-hash export and works for tenants where Auth0 won't release bcrypt hashes for export.
5. Operational differences worth noting
| Topic | Auth0 default | Gate default |
|---|---|---|
| Refresh token rotation | Optional (off by default) | Rotated on every refresh; the old token stops working |
| Compromised-password check | Optional (Breached Password Detection add-on) | Built-in haveibeenpwned check at sign-up + password-change |
| Password composition rules | Configurable | None (NIST 800-63B-4 deprecates) |
| Idle session timeout | 30 days default | 30 minutes default (configurable per SessionPolicy.idleTimeoutMins) |
| Absolute session timeout | 30 days default | 8 hours default (configurable per SessionPolicy.absoluteTimeoutMins) |
| Audit log retention | 30 days on standard tiers | 90 days hot tier + up to 7 years cold tier per Security §2.3 |
| SIEM forwarding | Premium / Enterprise tier feature | Included per Security §2.6 |
Default-tightening on sessions and the haveibeenpwned check are deliberate — Gate's defaults reflect a higher-security baseline than Auth0's general-purpose defaults. Loosen them via SessionPolicy configuration if your application's threat model warrants.
6. See also
- Migration overview — capability comparison across all third-party identity vendors.
- API → Auth — the canonical Gate API surface.
- Gate Overview — Standalone vs Native consumption paths.
- Identity-Aware Kernel — conceptual model.
- Gate Studio — visual authoring for branded login pages, Maker-Checker registration flows, and theming.
- Pricing — usage-based pricing and plan bundles.