Enabling Multiple Database Connections for a Single Application

Overview

If an application has two database connections enabled, a user trying to log in to an application with no connection parameter specified in the /authorize request may run into the following error, even if the credentials they entered were correct. This article explains how to allow users from both database connections to log in.

Wrong email or password

Applies To

  • Database Connections

Cause

When two or more databases are enabled for a connection, Auth0 needs a hint as to which database it should attempt to log the user in against. By default, Auth0 will only use the first available database connection.

Solution

This hint can be provided via the connection parameter in the /authorize request, indicating the name of the connection the user should be logged in against.

Alternatively, it may be easier to use only one database connection per application and differentiate the users via Roles and/or Organizations. To have multiple database connections associated with a single app, be sure that both are toggled on in the Application Settings > Connections tab.

Related References