Skip to main content

Auth0 Best Practises

Overview

This documentation aims to cover best practises when working with Auth0.

Tenants and Environments

It is recommended to create a dedicated Auth0 tenant per environment. There are many benefits to doing this but it allows us to isolate our production user base from other environments as well as configurating different administrators per environment. It is also recommened so you can isolate changes to Actions per environment. One other main factor here is rate limits for tenants tagged as Production as the difference is vast.

We are able to link tenants so environments become identical. This means our development/staging/testing environments contain the same feature set as prodution.

Custom Domains

It is strongly recommended to use custom domains for all production environments. This includes when having multi region tenants.

Log Files

Log files are only stored on Auth0 for a limited amount of time. We should therefore stream logs to an external service or export log events using an available extension.

Emails

Auth0 only provides a test email provider. This test provider can only send a limited number of emails so it is advised to configure our own mail server. Because we are going to use the middleware and Exponea to send emails this work is a prerequisite to this best practise. We should look at how we link environments between Auth0 tenants and environments as sharing a single provider between tenants can result in outages.

Store custom code in Gitlab

Any custom code for Actions, Rules, Hooks, custom database scripts, or Webtasks should be stored in Gitlab. Auth0 has a GitLab extension to help us store source code for version and audit control.

Resources