Skip to main content

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​

CapabilityAuth0Gate
Email + password sign-inUniversal Login / Database Connectionsgate.signIn({ email, password })
Magic linkPasswordless connections (email channel; link send_type)gate.passwordless.requestMagicLink → gate.passwordless.verifyMagicLink
OTPPasswordless connections (email channel; code send_type)gate.passwordless.requestOtp → gate.passwordless.verifyOtp
Social OAuthSocial Connections (Google, GitHub, Microsoft, etc.)gate.signInWithProvider({ provider: 'google' }) → gate.completeSignIn()
SAML / OIDC federationEnterprise OIDC or SAML Connectiongate.signInWithProvider({ provider: 'saml' })
AD / LDAPEnterprise AD/LDAP Connection (via Auth0 AD/LDAP Connector)Federate via gate.signInWithProvider({ provider: 'saml' }) (AD/LDAP fronted by an enterprise IdP via SAML)
Passkeys / WebAuthnPasskeys (early-2024 GA)See API → Auth §6
MFA — TOTPMFA Enrollment PoliciesEnd-user TOTP enrollment: POST /@<projectSlug>/gate/mfa/totp/enroll and .../totp/confirm
MFA — SMSMFA Enrollment Policies (Twilio integration)Not supported (SIM-swap risk; NIST 800-63B-4 deprecation)
Recovery codesRecovery codes flow10 single-use codes mandatory at MFA enrollment
JWT issuanceRS256 / HS256 with rotated signing keysEdDSA (default) or RS256 per project; JWKS at <orgSlug>.api.k9o.io/@<projectSlug>/auth/jwks (response wrapped in the standard { data } envelope)
Token TTLsConfigurable per tenantAccess token 30 minutes (5 to 60); sign-out after 30 days of inactivity and a 90-day maximum session length, set per project
Refresh tokensRefresh 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
SessionsSession policy per tenantSessionPolicy { idleTimeoutMins, absoluteTimeoutMins, maxConcurrentSessions } per project
Branded hosted UIUniversal Login customizationGate Studio visual authoring (separate extension)
Custom email templatesEmail Templates per tenantTriple-trigger pattern per /api/auth §8; BYO templates via the generate*Link form or platform-hosted with overrides via Gate Studio
Rules / ActionsAuth0 Rules (deprecated) / ActionsWebhook subscriptions per Security §2.6 + Maker-Checker policy gates per Control for action-time enforcement
MAU-based pricingPer-MAU tier50K 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 typeGate equivalent
DatabaseBuilt-in — gate.signIn({ email, password }); no provider setup
Passwordless (email link / OTP)Built-in — gate.passwordless.*; no provider setup
Social OAuthgate.signInWithProvider({ provider: 'google' | 'github' | 'microsoft' })
Enterprise SAMLgate.signInWithProvider({ provider: 'saml' }); the SAML IdP metadata + ACS is registered in the Console at /admin/auth/providers/saml
Enterprise OIDCGeneric OIDC is not supported — federate via 'saml', or use a hosted social provider
Enterprise AD/LDAPConfigured 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.created for 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.

Auth0 connectionGate pathDatabase, hashes in the exportDirect hash importbcrypt kept, re-hashed to Argon2idDatabase, hashes not releasedFederated migration windowAuth0 as OIDC provider, then disconnectedSocial / Enterprise connectionsRe-configure under Gateno password data to migratePasswordless connectionsRe-configure the flowno persistent secret to migrate
Your Auth0 connection mix, and whether Auth0 releases password hashes, selects the user-data path.

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:

PathWhen to use
Direct hash importBulk 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 windowConfigure 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.
UserGateAuth0window opensign inauthenticate via Auth0 (OIDC)sign-in succeedscapture the passwordArgon2id hash on user recordsigned inwindow closedsign incheck the Gate-side hashAuth0 is disconnectedsigned in
During the window users authenticate through Auth0 and Gate keeps the hash; once it closes, Gate verifies sign-ins on its own.

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 attributeGate equivalentMigration note
user_idUser.externalIdPreserve as a reference; Gate issues its own usr_<base62> ID
email_verifiedUser.state (verified if true, pending_verification otherwise)Map at import time
blockedUser.state = 'locked'Map at import time
MFA enrollmentRe-enrollment requiredTOTP 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 loginUser.lastSignInAtMap 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​

TopicAuth0 defaultGate default
Refresh token rotationOptional (off by default)Rotated on every refresh; the old token stops working
Compromised-password checkOptional (Breached Password Detection add-on)Built-in haveibeenpwned check at sign-up + password-change
Password composition rulesConfigurableNone (NIST 800-63B-4 deprecates)
Idle session timeout30 days default30 minutes default (configurable per SessionPolicy.idleTimeoutMins)
Absolute session timeout30 days default8 hours default (configurable per SessionPolicy.absoluteTimeoutMins)
Audit log retention30 days on standard tiers90 days hot tier + up to 7 years cold tier per Security §2.3
SIEM forwardingPremium / Enterprise tier featureIncluded 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​