Docs

User Migration Scenarios

Here are some sample scenarios for migrating users from Gigya, Okta, and Stormpath to Auth0. Each of these scenarios assumes that you have accounts on those platforms.

Prerequisites

Configure the custom database connection.

  1. Create a new database connection in the Connections > Database section of the Dashboard.

Create a new DB Connection

  1. Connect the database to the application. Navigate to the Applications tab of your database settings, under the Applications Using This Connection heading you can enable the database connection for each application.

Database Connection Applications

Scenario 1: Migrate Users from Gigya to Auth0

  1. Export Gigya users. Use Gigya's IdentitySync to transform and export user data to match a target schema. For more details on this process, see Gigya IdentitySync: Using IdentitySync.

    Follow the instructions to transform your Gigya database's user data to the correct schema and export the transformed data to JSON format.

  2. Import your Gigya users into Auth0 with the User Import/Export Extension or the Management API.

    • Go to the Extensions section of the Dashboard. Select the User Import / Export extension and install it. Once the extension is installed, you can click it to open an import/export interface that looks like this:

      User Import/Export Extension

      Drag your exported Gigya users JSON file into the designated upload area and select the database you created earlier. Click the Start Importing Users button to begin your import. For more information, see User Import/Export Extension.

    • Alternatively, you can use the Management API. Create a job to import your users to Auth0. For detailed instructions, see Bulk User Imports.

Scenario 2: Migrate Users from Okta to Auth0

  1. On the Settings page for your database connection, enable the Import Users to Auth0 option:

Dashboard Import Users Option

  1. Create the Login Script. The Login script is executed when a user attempts to log in, but their account is not found in the Auth0 database. You will need to create a script which will call the Okta Primary Authentication endpoint, passing the email and password as the username and password parameters.

On successful authentication, Okta will return an Authentication Transaction object, containing the user's profile in the embedded resources. You can then simply extract the user's information and pass it to Auth0 in the callback function.

You can click the Try button above the script to test and see whether the script works.

  1. Create the Get User Script. The Get User script is executed when the user attempts to do a password reset but their account is not found in the Auth0 database. You will need to create a script which will call the Okta Get User with Login endpoint, passing the user's email as the login parameter.

You will also need to Create an API token which must be passed to this endpoint in the Authorization header.

If successful, Okta will return a User object with the user's information. Once again, you can extract the user's information and pass it to Auth0 in the callback function.

Click the Try button above the script to test and see whether the script works.

  1. Test the custom database connection to ensure that it works.

    • Click on Try connection:

      Try Connection

      The Auth0 Lock widget will appear. Enter the email address and password for the Okta user, and click on Log In:

      Try Connection - Lock

      You should see a web page indicating that the connection works, with information about the user:

      Try Connection - Success

    • Navigate to the Users section in the Auth0 Dashboard to see the newly imported users listed:

      Imported User

Scenario 3: Migrate users from Stormpath to Auth0

  1. On the Settings page for your database connection, enable the Import Users to Auth0 option:

    Dashboard Import Users Option

  2. Navigate to the Applications tab of your database connection. Here you can choose the applications which will use the database connection.

    Database Connection Applications

  3. Create the Login Script. The Login script is executed when a user attempts to log in, but their account is not found in the Auth0 database. You will need to create a script that calls Stormpath's API to authenticate the user, passing the user credentials as the username and password parameters.

    On successful authentication, the response from Stormpath will include the user account URL. Perform a second request to the account URL to retrieve the user's information. You can then extract the user's information and pass it to Auth0 in the callback function.

Click the Try button above the script to test and see whether the script works.

  1. Create the Get User Script. The Get User script is executed when the user attempts to do a password reset but their account is not found in the Auth0 database. You will need to create a script which will call the /accounts endpoint of the Stormpath API, passing the user's email as the email parameter.

    If successful, Stormpath will return a the user's information. You can extract the user's information and pass it to Auth0 in the callback function.

Click the Try button above the script to test and see whether the script works.

  1. Test the custom database connection to ensure that it works.

    • Click on Try connection:

      Try Connection

      The Auth0 Lock widget will appear. Enter the email address and password for the Stormpath user, and click on Log In:

      Try Connection - Lock

      You should see a web page indicating that the connection works, with information about the user:

      Try Connection - Success

    • Navigate to the Users section in the Auth0 Dashboard, you will see the newly imported user listed:

      Imported User

Keep reading