---
title: Migrate from Auth0
description: Learn how to migrate users and organizations from Auth0.
icon: auth0
breadcrumb:
  title: Migrations
  url: /migrate
originalPath: .tmp-workos-clone/packages/docs/content/migrate/auth0.mdx
---

## Introduction

The WorkOS AuthKit API allows you to migrate your existing user data from a variety of existing sources. In this guide, we will walk through the steps to export, and then import your users from Auth0.

## (1) Exporting Auth0 user data

Auth0 allows their customers to export user data using several tools, which are outlined in [Auth0’s export documentation](https://auth0.com/docs/troubleshoot/customer-support/manage-subscriptions/export-data). A combination of exports may be necessary to retrieve all of the desired user information, including passwords.

The first tool is [Auth0’s “Bulk User Export” jobs](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports). These export jobs can be created programmatically using the [Auth0 Management API](https://auth0.com/docs/api/management/v2/jobs/post-users-exports), or through the official [Auth0 "User Import / Export Extension"](https://auth0.com/docs/customize/extensions/user-import-export-extension).

In both cases, an Auth0 customer can request which fields they’d like exported for each user, with the final output of the process being a newline-delimited JSON
file.

### Exporting passwords

If your Auth0 users currently sign-in using password-based authentication, and you’d like to import those passwords into WorkOS, then you will need to [contact Auth0 support](https://auth0.com/docs/troubleshoot/customer-support).

After opening a ticket with Auth0, it can take up to a week or more for your request to be processed. At the end you’ll be given another newline-delimited JSON file, containing a subset of user data such as ID, but more importantly the password hash.

> Auth0 does not make the plaintext passwords available for export.

---

## (2) Importing Users into WorkOS

Once you’ve obtained the necessary export files, you have two options for importing your user data into WorkOS.

### (A) Using the WorkOS import tool

WorkOS has a public [GitHub repository](https://github.com/workos/migrate-auth0-users) containing code that can be run to import users into WorkOS using the data retrieved in the previous step.

If you’d rather write your own code, the same process can be completed using the public WorkOS APIs, as described below.

### (B) Using WorkOS APIs

With the data from Auth0’s “Bulk User Export” job, you can use the WorkOS [Create User API](/reference/authkit/user/create) to import each of the users. Using the default fields from the [Auth0 export](https://auth0.com/docs/customize/extensions/user-import-export-extension#export-users), use the following mapping from Auth0 to parameters in your WorkOS Create User API calls:

| Auth0          |     | WorkOS API       |
| -------------- | --- | ---------------- |
| Email          | →   | `email`          |
| Email Verified | →   | `email_verified` |
| Given Name     | →   | `first_name`     |
| Family Name    | →   | `last_name`      |

### Importing passwords

If you also exported passwords from Auth0, you can import them during the [user creation](/reference/authkit/user/create) process, or later using the WorkOS [Update User API](/reference/authkit/user/update).

Auth0 uses the `bcrypt` password hashing algorithm, which is supported by WorkOS. Make sure to pass the following parameters to the WorkOS API:

- The `password_hash_type` set to `'bcrypt'`
- The `password_hash` set to the `passwordHash` field from your Auth0 export

### Migrating social auth users

If you have users who previously signed in through Auth0 using social auth providers, such as [Google](/integrations/google-oauth) or [Microsoft](/integrations/google-oauth), those users can continue to sign in with those providers after you’ve migrated to WorkOS.

Check out our [integrations](/integrations) page for guidance on configuring the relevant provider’s client credentials in WorkOS.

After your provider is configured in WorkOS, users can sign in with their provider credentials and will be automatically linked to a WorkOS user. WorkOS uses the **email address** from the social auth provider to determine this match.

> Some users may need to verify their email address through WorkOS if email verification is enabled in your WorkOS environment’s authentication settings.

Email verification behavior varies depending on whether the provider is known to verify email addresses. For example, users signing in using Google OAuth and a `gmail.com` email domain will not need to perform the extra verification step.

---

## Organizations

Auth0 has a concept of [“Organizations”](https://auth0.com/docs/manage-users/organizations) which are analogous to [WorkOS Organizations](/reference/organization), in that both represent a B2B customer.

### Creating Organizations

If you’d like to export your Auth0 organizations, you can use the [Auth0 Management API](https://auth0.com/docs/api/management/v2/organizations/get-organizations) to programmatically paginate through each Organization. You can then call the WorkOS [Create Organization API](/reference/organization/create) to create matching Organizations in WorkOS.

### Adding user memberships

You can export Auth0 organization memberships using Auth0’s “Bulk User Export” as described in the [Exporting Auth0 user data](/migrate/auth0/1-exporting-auth0-user-data) step, and then use the WorkOS [Organization Membership API](/reference/authkit/organization-membership/create) to add each user to their respective organization.

## Multi-Factor Auth

There are some differences between the Multi-Factor Auth (MFA) strategies offered by Auth0 and WorkOS.

Auth0 supports SMS-based second factors, however WorkOS does not due to known security issues with SMS. Users who have SMS-based second factors will need to switch to using email-based Magic Auth, or re-enroll in MFA using a TOTP-based authenticator instead.

## Wrapping-up

With your users now imported, you can now start using WorkOS to manage your Auth0 users. If you haven't, take a look at our [Quick Start guide](/authkit) to learn how to integrate WorkOS AuthKit into your application.
