Can we use two auth0 database connections for the same client?

Hi I am trying to this so as to keep the users separated for the two instances.
Yes it did work right when I created a new client as enabled the new database connection for the same. Just curious if it could work with the same client for both the connections.

I am currently getting an “unknown error” in the response, when I tried to do this.

I guess we can close this topic, as I was using the wrong client credentials.
Sorry for the noise.

But I guess something can be done on the side of handling the error, as the server should return a proper message that makes us easier to understand the cause. In this case the error was something like this

{

“date”: “2019-02-13T12:29:34.843Z”,
“type”: “fs”,
“description”: “unknown error”,
“connection”: “myconnection”,
“connection_id”: “”,
“client_id”: “client-id”,
“ip”: “------”,
“user_agent”: “Other 0.0.0 / Other 0.0.0”,
“details”: {
“body”: {
“tenant”: “--------”,
“client_id”: “--------”,
“connection”: “myconnection”,
“email”: “thomas@gmail.com”,
“password”: “*****”,
“user_metadata”: {
“firstName”: “thomas”,
“lastName”: “james”
}
}
},

Hello @priya.sharma.9362,

If you want to use two or more Auth0-hosted user databases with a single client, all in one tenant, I believe the only caveat is you need to always explicitly state which connection you want to work with.

Another possibility, which I think should work, have two clients configured in Auth0, one for each database, and have your app use one client or the other based on some parameter that defines which user community your app is dealing with.

1 Like

Hey @priya.sharma.9362!

Glad you were able to eventually get it working! I’ll close the topic but feel free to reopen it whenever there will be such need!