OAuth 2.0 Authorization Framework
Set Up Multiple Environments
Development, Test, QA environments are easy to setup in Auth0. Simply create a new tenant for each to guarantee the maximum isolation between these environments. You can easily switch between tenants using the tenant chooser from the top right menu on the dashboard. You can also configure different administrators for each.
The example above uses a simple naming convention to distinguish each environment, though you can name your multiple environments any way you prefer. For production environments, we strongly recommend using custom domains.
Set the Environment
For each new tenant created, you should specify its environment. You can assign environment tags to your tenants to differentiate between development, staging, and production environments.
To assign an environment tag to a tenant, go to the Auth0 Support Center > Tenants. Locate your tenant and click the gear icon to bring up the Settings section.
Next, select the Assign Environment Tag option. Use the form to identify your tenant's environment as either
After selecting the environment, click on Save Changes.
For easier configuration management, save your configuration values in the Dashboard, instead of hardcoding them into your rules or db connections scripts.
For example, let's say you want to set a URL for logs. One way to do it is to hardcode it in the rule:
This code, however, is not portable since this URL will likely change from development to production.
The recommended way of working with code that you need to use/move from development to product is via Rules section. If you have not yet created a rule, you'll need to do so. (Otherwise, jump to step 4.)
- Click Create Your First Rule.
- Choose the empty rule template.
- Enter a name for your new rule, and click Save.
- Navigate back to Auth0 Dashboard Rules, and scroll to the bottom of the page to set your configuration values (we will use
log_urlfor the key name, and
https://someurl/logfor value), then click Create.
- Now, you can write your rule. Edit the rule you created, enter the following code in the code area, and click Save.
This code is portable, and when you migrate to production, you only need to change this setting instead of searching your scripts.
If you use multiple Auth0 tenants with AD/LDAP, you will need to create an AD/LDAP Connection and set up an AD/LDAP Connector for each tenant. This is because each AD/LDAP Connector is tied to a specific Connection within an Auth0 tenant.
Multiple AD/LDAP Connectors can point to the same AD or LDAP directory, but each AD/LDAP Connector can only be used by one Connection within one Auth0 tenant.
If you have multiple AD/LDAP directories against which users will authenticate (for example, to support different departments or customers, each with their own directory), you can set up multiple AD/LDAP Connectors within each Auth0 tenant.