Auth0 Migration Guide
It may seem like an uphill battle when it comes to changing your authentication provider; however, with Descope's migration tool, you can rest assured your migration will be a breeze.
There are two ways you migrate to Descope from Auth0. You can either do a Full Migration or a Hybrid Migration.
- Full Migration - You completely move off of Auth0 to Descope, no longer using Auth0 in any way. (Most Common)
- Hybrid Migration - You still use Auth0 but you will authenticate your users with Descope (as a federated IdP).
This documentation will cover both of these migration options. If you want to continue with the Hybrid Migration, complete the first step under Full Migration first, and then skip to Hybrid Migration.
Full Migration
There are various options for migration including the ability to migrate via Auth0 API if you have less than 1000 users, JSON export when you have more than 1000 users, without passwords, and with passwords.
If you desire to completely move away from Auth0, the Full Migration option is the one for you. Otherwise, complete Step 1 under the Full Migration guide and then skip to the Hybrid Migration section.
Prerequisites
Ensure you have the following before starting:
- Access to your Auth0 account with Permissions
- Familiarity with your current Auth0 setup
1. Importing from Auth0
Configure Local Environment
Follow these steps to set up your environment for migration:
-
You will need to have your Auth0 Tenant ID. Your Auth0 Tenant ID can be found in the URL of your Auth0 dashboard. For example, your URL might look something like this:
https://manage.auth0.com/dashboard/us/dev-xyz/
within this example, your tenant ID would bedev-xyz
. -
You will need to generate a Auth0 token. You can generate these 24 hour tokens from this location within Auth0.
-
You will need your Descope project ID which can be found here.
-
You will need a Descope Management Key, if you do not already have one stored, you can create one here.
-
The tool depends on a few custom user attributes that will automatically be created for you within Descope to assist you with the migration. The below outlines the machine names of the attributes created within the user's custom attributes section of the Descope console.
connection
(type: text): This custom attribute will contain the different connection types associated to the user which was migrated from Auth0.freshlyMigrated
(type: Boolean): This custom attribute will be set to true during the migration. This allows for you to later check this via a conditional during Descope flow execution, see Post-Migration.
-
(Optional) If you would like to migrate passwords, open a ticket with Auth0 support to request an export of your user's password hashes.
-
(Optional) Due to the Auth0 API limitation for loading users, even with pagination, if you have over 1000 users within Auth0, it is recommended to export a JSON of users if you have more than 1000 users. To export the JSON, follow these steps.
-
Clone the Repo:
- Create a Virtual Environment
- Install the Necessary Python libraries
- Setup Your Environment Variables
You can change the name of the .env.example
file to .env
to use as a template. Then populate with the items generated
within the prerequisites section of this guide.
Note
The migration tool source code can be found on GitHub
Running the Migration Script
You can use the -v
or --verbose
flags to enable more detailed output. This works for both live and dry runs, providing you with additional information.
Migrating from JSON Export:
The below is a list of examples of execution flags that are available when migrating from Auth0 using a JSON export with and without passwords.
Migrating with Auth0 API:
Dry Run
You can dry run the migration script which will allow you to see the number of users, tenants, roles, etc which will be migrated from Auth0 to Descope.
With Passwords
The output would appear similar to the following:
Without Passwords
The output would appear similar to the following:
Live Run
To live migrate your Auth0 users, follow the below examples with and without passwords.
With Passwords
The output will include the responses of the created users, organizations, roles, and permissions as well as the mapping between the various objects within Descope. A log file will also be generated in the format of migration_log_auth0_%d_%m_%Y_%H:%M:%S.log
. Any items which failed to be migrated will also be listed with the error that occurred during the migration.
Without Passwords
The output will include the responses of the created users, organizations, roles, and permissions as well as the mapping
between the various objects within Descope. A log file will also be generated in the format
of migration_log_auth0_%d_%m_%Y_%H:%M:%S.log
. Any items which failed to be migrated will also be listed with the error that
occurred during the migration.
2. Testing and Finalizing Migration
Once all of these have been completed, it's a good idea to perform comprehensive testing to ensure all functionalities are working as expected, and your user migration went smoothly.
Congratulations, you've fully migrated to Descope! If you're doing the Hybrid Migration approach, you can read on to the next section of this documentation.
Hybrid Migration
Hybrid Migration is less common with Auth0; however, if you have a specific use case, Descope can be used as your authentication service within Auth0.
1. Integrating Descope as an Identity Provider
Assuming you've already followed the Step 1 under Full Migration above, you should already have all of your users, tenants, permissions, and roles in Descope. After successfully importing from Auth0, you can proceed with configuring Descope as an external identity provider.
To do this, follow the guide on configuring Descope as an external identity provider for Auth0.
2. Testing and Finalizing Migration
Once you configured Descope as an external identity provider, you should be able to now login using Descope Flows. Once all of these steps have been completed, it's a good idea to perform comprehensive testing to ensure all functionalities are working as expected, and your user migration went smoothly.
Post Migration Verification
Once the migration tool has ran successfully, you can check the users, roles, permissions, and tenants for the migrated items from Auth0. Make sure to verify the created items based on the output of the migration tool.
Also, you can define your user's login experience. Utilizing the freshlyMigrated
custom user attribute, you can define a path for your user.
You can then go down different paths from this conditional within the flow. If you'd like to verify the user's email or phone, you can, and then proceed with adding passwords (or forcing update of password if you migrated passwords) and passkeys.
Then after defining the user's experience, you will need to update the user's properties setting the freshlyMigrated
attribute to false
.