Skip to content
Udibo

Move a React app from Auth0

udibo/migrate-from-auth0-react is a public repository that moves one application from Auth0 to Udibo, one tagged commit at a time. It starts from Auth0's own React single-page sample: a React app that signs in with @auth0/auth0-react and calls an Express API that checks Auth0 access tokens. The links below show the application changes and the tests that cover them.

The move has two phases, and you can stop between them:

  • Phase A: change the library, keep Auth0. The app takes @udibo/oauth2 while it still signs in through your Auth0 tenant. No user, client or Auth0 setting changes.

  • Phase B: change the issuer, then move the users. Three configuration values point the app at a Udibo tenant. The users follow by import, with or without their passwords.

This page is the walkthrough for that one app. For the decisions every migration needs, such as identity mapping, rehearsal and rollback, read Move an existing application first.

TagWhat changesEvidence
step-0-upstreamAuth0's sample signs in through Auth0.React entry point
step-1-udibo-packageThe app uses @udibo/oauth2 and still signs in through Auth0.Client and API changes
step-2-udibo-idpThe same app signs in through a Udibo tenant.Browser test changes
step-3-user-importThe converter prepares user records for import without passwords.Export and conversion changes
step-4-password-migrationThe converter marks eligible accounts for a password check against Auth0 at first sign-in.Import-record tests

Before you start

  • Node.js 22.12 or later. The repository's tests run on Node.js 22 and 24.

  • A clone of the repository, checked out at the tag for the step you are reading.

  • No tenant, to read the diffs and run the default tests. From step-1-udibo-package on, the browser tests sign in through the package's local identity provider, which the test run starts itself.

  • A tenant, to sign in through a real one. The repository's README lists the Auth0 and Udibo settings its own test tenants use, under Set up the Auth0 tenant and Set up the Udibo tenant. Use tenants that hold made-up users only. The site at udibo.com says how to get a Udibo account.

Install the dependencies and run the tests that need no tenant:

Shell
npm ci
npm test
npm run test:behavior
npx playwright install --with-deps chromium
npm run test:e2e

npm test is the sample's own component tests. npm run test:behavior builds the app and tests the app server and the API as separate processes; from step 3 on it also tests the export and import-record scripts. npm run test:e2e signs in through Chromium. At step-0-upstream that last command needs an Auth0 tenant, because Auth0's SDK cannot sign in through the local identity provider.

Phase A: adopt @udibo/oauth2 while still signing in through Auth0

Step 1 replaces @auth0/auth0-react with @udibo/oauth2 0.51.0 and changes nothing at Auth0. It is worth doing by itself: once the app runs on a standards-based client, moving to another issuer is configuration.

What changed in the app

FileBeforeAfter
package.json@auth0/auth0-react@udibo/oauth2; every dependency pinned to an exact version and upgraded, React Router from 6 to 7
src/auth.js (new)NoneCreates a DirectClient: a public client with no secret, PKCE, and the app's origin as the redirect URI
src/index.jsx<Auth0Provider domain clientId authorizationParams><OAuth2Provider client>
src/App.jsxThe SDK completes the sign-in on whichever page Auth0 returns toThe home route renders <OAuth2Callback> when the URL carries state with code or error
src/components/NavBar.jsxuseAuth0(), loginWithRedirect(), logout({ logoutParams })useOAuth2(), login(), logout({ returnTo })
src/views/Profile.jsxwithAuthenticationRequired(Component)<RequireAuth fallback={<Loading />}> around the component
src/views/ExternalApi.jsxgetAccessTokenSilently(), and pop-ups to sign in or consent againuseDirectClient() and client.getAccessToken(); signing in or consenting again is a redirect
src/config.js, vite.config.js, .env.exampleAUTH0_DOMAIN, AUTH0_CLIENT_ID, AUTH0_AUDIENCEOAUTH_ISSUER, OAUTH_CLIENT_ID, OAUTH_AUDIENCE
api-server.jsBuilds the issuer from AUTH0_DOMAINReads the issuer URL from OAUTH_ISSUER; still checks tokens with express-oauth2-jwt-bearer

For Auth0, OAUTH_ISSUER is https://<your tenant's domain>/, with the trailing slash, exactly as the tenant's discovery document names it.

The package's React guide documents the provider, hooks and components the diff uses.

What stays specific to Auth0

  • The audience sign-in parameter. The sample's API accepts only an access token issued for its own audience, and the sample asks Auth0 for it in the sign-in request (Auth0's access token reference, read on 2026-11-29, says to check that a failing token "was issued with your custom API as the audience"). DirectClient has no option for a default sign-in parameter, so src/auth.js subclasses it to add audience to every sign-in (udibo/oauth2#189 tracks the option). The browser tests check that the parameter is sent.

  • The API's token check. The API stays on express-oauth2-jwt-bearer through every step. It only needed the issuer as a full URL.

  • The Auth0 dashboard settings, which are unchanged. The repository's README lists the ones the app depends on, under What Auth0 still needs to be configured with. That list is what Phase B has to replace.

What your users notice

The repository's README records each of these under Behaviour that changes:

  • A page reload starts signed out. The client keeps tokens in memory and the sample requests no refresh token, so a reload has nothing to resume from. A protected page starts a new sign-in, which the provider completes without asking for the password while its own session lasts.

  • Pop-up sign-in becomes a redirect. @udibo/oauth2 has no pop-up flow. The API page's two recoveries, signing in again and consenting again, send the browser to the provider and return to the same page.

  • An expired access token needs a new sign-in, for the same reason as the reload.

If a reload must keep the session, plan a backend that holds the tokens before you start: see choose the client type. The example keeps the browser-only shape so that each diff stays small.

Check it against your Auth0 tenant

Shell
E2E_PROVIDER=auth0 npm run test:e2e

This runs the same browser tests through a real Auth0 tenant. It reads AUTH0_DOMAIN, AUTH0_CLIENT_ID, AUTH0_AUDIENCE, AUTH0_TEST_USERNAME and AUTH0_TEST_PASSWORD from the environment or an untracked .env.local, and refuses to start without them. The tests are step 0's, adapted at step 1 to the new client: the sign-in request no longer carries nonce or response_mode, which the README lists under Behaviour that changes. A pass means sign-in, the profile, the API call and sign-out still work against your tenant, with the changes that section lists.

You can release Phase A and stop here. Nothing in it depends on Udibo's hosted service.

Phase B: switch to a Udibo tenant

No file under src/ changes, and neither does api-server.js. The diff is the .env.example comment, the browser tests' description of the Udibo sign-in page, the scheduled workflow and the README. In your clone, git diff step-1-udibo-package step-2-udibo-idp -- src/ api-server.js prints nothing. The move is three values:

SettingAt Auth0At Udibo
OAUTH_ISSUERhttps://<your tenant's domain>/Your tenant's issuer, such as https://{tenant-id}.udibo.com, with no trailing slash
OAUTH_CLIENT_IDThe Auth0 application's client IDThe Udibo application's client ID
OAUTH_AUDIENCEThe Auth0 API's identifierThe audience set on the Udibo application

Register the application in Udibo

Udibo does not import another provider's client IDs or secrets, so the app gets a new registration. In your tenant's dashboard, create an application like the example's:

Get started shows where the issuer and client ID appear.

What differs from Auth0

  • The audience belongs to the application. Udibo takes an access token's audience from the application's own setting, not from a sign-in parameter, and there is no separate API object to authorize the application for. The client still sends audience; it no longer decides anything.

  • Cross-origin calls need no separate setting. Registering the redirect URI on a public application is what lets that page call the token endpoint.

  • The API keeps working unchanged. In the example, express-oauth2-jwt-bearer checks Udibo's access tokens against the new issuer's keys as it checked Auth0's.

  • A user without an email has no email claim. The example's Udibo test user signs in with a username, so the sample's profile heading, which shows email, is empty for that user. Check which claims your own pages read.

Check it against your Udibo tenant

Shell
E2E_PROVIDER=udibo npm run test:e2e

It reads UDIBO_ISSUER, UDIBO_CLIENT_ID, UDIBO_AUDIENCE, UDIBO_TEST_USERNAME and UDIBO_TEST_PASSWORD the same way. Keep running the Auth0 command beside it while you move: the same code, configured for Auth0, still signing in is your rollback by configuration.

Move your clients one at a time

A new registration means each client changes its configuration, so plan the order instead of one switch:

  1. Register every client again in Udibo. Each app, API caller and machine client gets a new client ID, and a confidential one a new secret.

  2. Have your APIs accept tokens from both issuers while clients move. Validate each token against its own issuer, keys and audience, as connect a test application first requires. With express-oauth2-jwt-bearer, which checks one issuer, the example's README suggests one middleware per issuer, or a second instance of the API for the Udibo clients. If you use two checks in one API, run the second whenever the first rejects the token or cannot load its issuer's keys, so the other issuer's valid tokens still work. The example has one client and does not test a two-issuer cutover.

  3. Move clients one at a time, each by its three settings.

  4. Turn Auth0 off last, once the final client has moved and the tokens Auth0 issued to it have expired. If you take step 4 below, Auth0 stays up until the end date you set there.

Until the users are imported, a person with only an Auth0 account cannot sign in through Udibo. Import a test cohort before you move the first client that real people use. A third-party application asks its users for consent again, and sessions do not carry across: everyone signs in once after the move.

Move the users

You choose one of two imports before anything is imported. An import skips an account that already exists, so an account imported without step 4's marker cannot be given it by importing again.

Step 3: import without passwordsStep 4: check passwords against Auth0 once
First sign-inBy emailed code or link, or by setting a password with "Forgot password?"With the person's Auth0 password
Needs from Auth0A profile exportA profile export, and a dedicated Auth0 application that stays up until your end date
What Udibo sends outNothingEach pending user's password to Auth0, at that user's sign-in
Tested in the exampleThe export and conversion scripts, by automated tests with synthetic records; one real export and one import rehearsed by hand on a local UdiboThe import records only

If you hold password hashes in a format the import accepts, a third way is to add them to the records as legacyCredential. The example does not: Auth0's documentation, read on 2026-11-29, releases hashes only through a support request that "is not available for our Free subscription tier" (Export Data), with an eligibility review, a signed acknowledgment form and a PGP key (Export Password Hashes and MFA Secrets). The example's tenant is on that plan. Read those pages for your own plan.

Step 3: import the users without passwords

The app does not change. The step adds three scripts and a shared file-writing module under scripts/, their tests in test/export-auth0.behavior.mjs, and two package.json commands.

Export the users from Auth0:

Shell
npm run export:auth0 -- auth0-users.ndjson

The script signs in as an Auth0 machine-to-machine application authorized for the Auth0 Management API with read:users alone, and reads AUTH0_DOMAIN, AUTH0_EXPORT_CLIENT_ID and AUTH0_EXPORT_CLIENT_SECRET. It asks Auth0 for a user export job and downloads the result. It writes the file with owner-only permissions, refuses to overwrite one, and prints no record. The file holds every user's email address and profile; git ignores *.ndjson.

Turn the export into Udibo import records:

Shell
npm run auth0-to-udibo -- auth0-users.ndjson udibo-import.ndjson

The converter at step 3 writes the import file format with this mapping:

Auth0Import record
email, email_verifiedemail, emailVerified
nickname, given_name, family_name, nameusername, firstName, lastName, displayName
Social identities[] from google-oauth2, github or appleidentities[] with provider google, github or apple, and the identity's user_id as subject
app_metadata, user_metadatametadata, userMetadata

Read the command's report before you send the file:

  • No record carries a password. A hash a record does carry is dropped and counted.

  • Other social identities are left out and counted. A user whose only sign-in was one of those signs in by email instead.

  • username comes from Auth0's nickname. The import skips a record whose supplied username is already taken, so look for users who share a nickname before you send the file. In the example's export each user's nickname was the local part of their email address.

  • A user blocked in Auth0 is still written, and imports as a working account. Remove those records if they should not have one.

Have the file imported. Udibo runs the import for you: you agree a secure channel, send the file, and ask for a dry run first, as Udibo runs the import for you describes. Your own deployment cannot call it. Rehearse with a small cohort and reconcile the imported, skipped and error counts.

Tell people how their first sign-in works. An account imported this way has no password. Its owner signs in with an emailed code or link, when your tenant offers email sign-in, or sets a password through "Forgot password?". Both need the person to still read that inbox. Second factors and passkeys do not come across; people enroll again.

Step 4 (optional): keep the passwords

Step 4 takes the place of step 3's import. Each eligible database user from the selected Auth0 connection is imported with a remotePassword that names their Auth0 account, and your Udibo tenant registers the Auth0 tenant as its password migration source. The first time that person signs in at Udibo with their old password, Udibo checks it against Auth0 once, then stores it in its own format. Password migration at sign-in is the reference for all of it, including what it costs.

The example has not run this step end to end. Its tests cover which records get a remotePassword. Connecting the source and an imported user's first sign-in were not run through the example's tenants, which its README states under What was tested.

The diff changes scripts/auth0-to-udibo.mjs and its tests. The same command takes one flag:

Shell
npm run auth0-to-udibo -- --remote-password=Username-Password-Authentication auth0-users.ndjson udibo-import.ndjson

The flag's value is the name of the Auth0 database connection your users sign in to, matched exactly; it is also the realm you give Udibo. Each database user of that connection gets:

Import recordFrom Auth0
remotePassword.subjectuser_id
remotePassword.loginemail, or username for a user with no email

The command reports how many records it marked. It leaves a user unmarked, to sign in the step 3 way, when they are a social user or belong to another connection, when Auth0 has them blocked, or when their record cannot name the account safely. The repository's README lists every case under Mark the password users.

Then, in order:

  1. Create the dedicated Auth0 application that Auth0 setup describes.

  2. Register the source in your Udibo dashboard, under Sign-in → Migration, as set up the source describes.

  3. Import one test user, and sign in as them, before the rest. A wrong subject or login cannot be corrected after the import and looks like a wrong password every time. When someone can't sign in reads the refusal for you.

  4. Import the full file, the same way as at step 3.

  5. Finish the migration after your end date, then delete the dedicated Auth0 application.

Leave users whom Auth0 asks for a second factor without remotePassword; the password migration guide's Auth0 setup says why. The export does not say who they are, so work from your own list.

Turn Auth0 off

Auth0 can go once all of these hold:

  • Every client has moved and the tokens Auth0 issued to it have expired.

  • The users are imported and the counts are reconciled.

  • If you took step 4, its end date has passed and you have told the people who never signed in that their first sign-in will be by email.

Keep the Auth0 configuration for your agreed rollback period, as cut over with a rollback plan describes: an account created only in Udibo does not exist in Auth0, and a password changed after the move does not work there.

How the example stays tested

The repository’s workflows run the install, test, export and conversion commands below. The behaviour tests call the --remote-password command-line handler directly:

  • On every pull request and every push to main, on Node.js 22 and 24, with no tenant: the install, npm test, npm run test:behavior and npm run test:e2e through the local identity provider.

  • Every Monday and on demand, the browser tests against an Auth0 tenant and a Udibo tenant. On other days the same job tests a newer @udibo/oauth2 release the first day npm lists one.

  • By hand only, the export and the conversion against the Auth0 tenant, printing field names and counts and no value.

The README's Tested with table records the package version and the last run for each step.

Next: prepare the import file, compare Udibo and Auth0, and review production readiness.

Last verified 2026-11-29.

View Markdown