Docs

User Profile Structure

Verify Users Script Templates

The Verify script implements the function executed to mark the verification status of a user’s email address in the legacy identity store. Email verification status information is typically returned via email_verified as part of any user profile information returned (see Login and Get User for further details). The script is executed when a user clicks on the link in the verification email sent by Auth0. We recommend naming this function verify. The script is only used in a legacy authentication scenario, and must be implemented if support is required for Auth0 email verification functionality.

While it’s not mandatory to implement the verify function, it is a recommended best practice. The function is required to support user email address verification, and a verified email address for a user is critical to a number of the workflow scenarios in Auth0. Implementing the script will provide support for these workflows out-of-box.

The verify function is called when a user clicks on the link in the verification email sent by Auth0. Change in email verification status influenced by other operations, such as via user profile modification in the Auth0 Dashboard, is performed via the Change Email script.

The verify function should be defined as follows:

Parameter Description
email The email address for the user as the user identifying credential.
callback Executed with up to two parameters. The first parameter is an indication of status: a null first parameter with a corresponding second parameter indicates that the operation executed successfully, while a non null first parameter value indicates that some error condition occurred.

User profile attributes

callback example

If the first parameter is null then the second parameter should be a JSON object in a format similar to the following:

Best practice

When indicating an error condition we recommend using the Error object to provide Auth0 with a clear indication of the error condition. For example, callback(new Error(“an error message”)).

View user profile

Language-specific script examples

Auth0 provides sample scripts for use with the following languages/technologies:

Keep reading

JavaScript

ASP.NET Membership Provider (MVC3 - Universal Providers)

ASP.NET Membership Provider (MVC4 - Simple Membership)

MongoDB

MySQL

Oracle

PostgreSQL

SQL Server

Windows Azure SQL Database

Request with Basic Auth

Keep reading