Custom Database Script Templates: Create Users
Auth0 provides the following custom database script templates that you can use when implementing user creation functionality.
While Auth0 has populated default templates in the Dashboard script editor, you can use the following links to recover the original code and notes once you've made and saved edits.
When working on your user creation script, keep in mind that:
- This script will create a new entry in your database.
- This script executes when a user signs up or when an administrator creates the user via the Dashboard or API.
When the script finishes execution, the Login script runs to verify that the user was created successfully.
user object will always contain the following properties:
|the user's email|
|password||the password entered by the user (in plain text)|
|tenant||the name of the Auth0 account|
|client_id||the client ID of the application for which the user signed up, or the API key if the user was created through the Dashboard or API|
|connection||the name of the database connection|
Finally, if you create and use custom fields during the registration process, these properties are included in the
user object as well.
Script execution results
There are three ways a Create Users script can finish:
||A user was successfully created|
||This user already exists in your database|
||Something went wrong while trying to reach your database|
Auth0 provides sample scripts for use with the following languages/technologies: