Skip to main content
You can use the Auth0 Dashboard test a custom database connection by authenticating users against the same or a separate tenant. Whether you have enabled importing users from your user store or not, start by creating a test tenant and application.

Create a test tenant and application

  1. Create a new tenant to use for testing.
  2. Create a Machine-to-Machine application. You need the application’s client ID and secret to enable scopes in the Management API and when you create custom database action scripts.
  3. Enable both the Password and Client Credential grant for this application.
    Auth0 Dashboard > Applications > Advanced Settings
  4. To authorize your application, navigate to Applications > APIs and select Management API.
  5. Under the Machine-to-Machine Applications tab, use the toggle to authorize your test application.
  6. Select the drop-down menu to enable the following Auth0 Management API scopes:
    • read:users
    • update:users
    • delete:users
    • create:users
    • read:users_app_metadata
    • update:users_app_metadata
    • create:users_app_metadata

Test with import users to Auth0 enabled

To test a custom database connection with import users enabled, after you create a tenant and an application, create a source database connection and a target database connection.
  1. From Dashboard > Authentication > Database, create two database connections (one to be the source and the other to be the target) with Required Username enabled. If you want to test using Organizations, enable Context object in database scripts.
    You can set the Password Policy to Non-empty password required in both target and source databases so you can use simple passwords in your tests.
  2. Create test users in your source database connection. From Dashboard > User Management > Users, select **+Create User > Create via UI. In the Create user window that opens, for Connection, choose your source database connection. Fill in the necessary fields, then select Create (or Create Another).
  3. Configure the target database connection:
    • On the Custom Database tab, toggle Use my own database.
    • On the Settings tab, enable Import Users to Auth0.
    • On the Custom Database tab, in the Database settings section, add the following information from the source database connection:
  4. Update the Login and Get User database action scripts in your target database.
  5. Select Save and Try on each script. You should monitor Actions Real-time Logs console.log output.
  6. Select Try Connection to test the connection live.

Test with import users to Auth0 disabled

To test a custom database connection with import users to Auth0 disabled, after you create a tenant and an application, create a source database connection and a target database connection.
  1. From Dashboard > Authentication > Database, create one test database connection to be the target.
  2. Update the database action scripts with the samples below.
    Update the Get User script with the following sample:
  3. Select Save and Try on each script. You should monitor Actions Real-time Logs console.log output.
  4. Select Try Connection to test the connection live.