Skip to Content
Docs

Migrate from Auth0

Move Auth0 users, bcrypt password hashes, social identities and Organizations with their members and roles into Pontive with pontive migrate, then replace the Auth0 SDK with pontkit.

The steps below use the pontive migrate CLI. Read Migrate to Pontive first for how runs, dry runs and matching work.

1. What moves and what does not

MovesDoes not move
Users from the Management API's export job: email and its verified flag, phone, username, names, picture, locale, created_at; user_metadata as metadata, app_metadata as private_metadata; blocked users as deactivatedPassword hashes, unless you ask Auth0 support for them (below). Without them, database users use Forgot password at their first sign-in
bcrypt password hashes, from Auth0 support's hash exportMFA secrets. Auth0 support can include them, in an undocumented format the exporter does not read: those users enroll TOTP again
Google, GitHub, Apple and OIDC identitiesMicrosoft account (windowslive) and Entra ID (waad) identities, and providers Pontive has no portable type for (Facebook, LinkedIn, …): those users link by verified email
Organizations, with their members and the roles assigned to them in eachTenant-level role assignments outside organizations, Actions and Rules, Universal Login branding
The Auth0 user_id (auth0|65f…), as legacy subject and external_idUsers without an email, which are left out and listed

Getting the hashes. Auth0 exports password hashes only through a support ticket, not on the Free plan, and delivers them PGP-encrypted. Ask early: it is the slowest step. Decrypt the file before passing it to the CLI:

gpg --output auth0-hashes.ndjson --decrypt <the file Auth0 sent>

2. Create the migration source

In Auth0, create a Machine to Machine application authorized for the Auth0 Management API with the scopes read:users, read:organizations, read:organization_members and read:organization_member_roles. Then:

export PONTIVE_SECRET_KEY=pontive_sk_test_us_...   # an admin key of your development instance
export AUTH0_DOMAIN=acme.us.auth0.com
export AUTH0_CLIENT_ID=...
export AUTH0_CLIENT_SECRET=...

npx pontive@latest migrate source create --name "Auth0" --type auth0   # prints msrc_...

3. Export, then dry run

npx pontive@latest migrate export auth0 --hashes auth0-hashes.ndjson   # writes pontive-users.ndjson
npx pontive@latest migrate import pontive-users.ndjson --source msrc_...

The export starts an Auth0 users export job, waits for it, then reads every organization and its members. --connection con_... exports one database connection only, --skip-organizations leaves organizations out, and --external-id none leaves external_id unset. The export report counts password users without a hash and the identities it left out.

The import with no --apply creates a run and dry-runs every batch: nothing is written.

4. Map roles and connections

Auth0 organization roles are your tenant's role names. Map each to an org role in Pontive, and make at least one of them owner, since every new organization needs an owner:

npx pontive@latest migrate import pontive-users.ndjson --source msrc_... \
  --role-map "Admin=owner,Member=member" \
  --identity-connection google=app_...:google \
  --identity-connection github=app_...:github
  • Create roles other than owner and admin first (member here), as Import options shows.
  • --identity-connection needs that connection set up on the Pontive app. Leave a type out and its users link by verified email instead.

Run it until the dry run's failures are the ones you accept.

5. Apply

npx pontive@latest migrate import pontive-users.ndjson --source msrc_... \
  --role-map "Admin=owner,Member=member" \
  --identity-connection google=app_...:google \
  --apply --delete-after

The CLI dry-runs once more, asks, then applies one batch at a time. Failed rows: npx pontive@latest migrate records uimp_... --outcome failed.

6. Swap the SDK

Create a confidential app in Pontive with the redirect URI https://<your origin>/api/auth/callback, then replace @auth0/nextjs-auth0 with @pontive/pontkit-nextjs in its server-session mode, which works the same way: the server signs in and keeps an encrypted session cookie.

npm uninstall @auth0/nextjs-auth0
npm install @pontive/pontkit-nextjs
lib/pontive.ts
import { pontiveAuth } from "@pontive/pontkit-nextjs/server";

// Replaces: export const auth0 = new Auth0Client();
export const pontive = pontiveAuth({
  issuer: process.env.PONTIVE_ISSUER!, // https://<auth domain>
  clientId: process.env.PONTIVE_CLIENT_ID!,
  clientSecret: process.env.PONTIVE_CLIENT_SECRET!,
  sessionSecret: process.env.PONTIVE_SESSION_SECRET!, // 32+ random characters
  baseUrl: process.env.PUBLIC_URL, // https://app.acme.com
});
app/api/auth/[...pontive]/route.ts
import { pontive } from "@/lib/pontive";

export const { GET, POST } = pontive.handlers;
proxy.ts
import type { NextRequest } from "next/server";
import { pontive } from "@/lib/pontive";

// Replaces: return await auth0.middleware(request);
export function proxy(req: NextRequest) {
  return pontive.middleware(req);
}
Auth0pontkit
/auth/login, /auth/logout/api/auth/login, /api/auth/logout
await auth0.getSession(), session.user.subawait pontive.auth(), session.user.id (usr_…)
await auth0.getAccessToken()session.accessToken
The org_id claimsession.organization: { id, roles, permissions } or null
@auth0/auth0-react: Auth0Provider, useAuth0()@pontive/pontkit-react: Provider, useAuthState(), SignedIn, SignedOut (React quickstart)
getAccessTokenSilently()Auth.getCurrentSession()?.access_token, Auth from @pontive/oidc-client
express-oauth2-jwt-bearer's auth()requireBearer(rs, …) from @pontive/pontkit-server (Protect an API)

session.user.id is the Pontive id. Code keyed by the Auth0 user_id reads it from the token once the claims template carries it (step 7). An Action that added custom claims becomes the same claims template.

7. Cut over

Follow the cutover checklist. For Auth0 in particular:

  • Export again just before switching and import into the same run with --run uimp_..., to catch users who signed up since.
  • If your database keys users by auth0|…, set the app's claims template to { "legacy_user_id": "{{ user.external_id }}" }.
  • Turn off Auth0's emails and sign-ups once the app is on Pontive. Users sign in once more.

8. Revert

npx pontive@latest migrate revert uimp_...          # dry run
npx pontive@latest migrate revert uimp_... --apply

Users who have signed in to Pontive since, and organizations with other members, are kept and listed. See Revert.