At least one database, enterprise or social connection needs to be available: error when using Lock

Problem statement

I am seeing an error, “At least one database, enterprise or social connection needs to be available” when trying to login, but the application I am logging into has connections enabled.

Symptoms

  • Using Lock SDK (Classic or custom login page)
  • Application has >50 DB connections enabled

"Something went wrong"error on screen
Console shows: “Uncaught Error: Error: At least one database, enterprise or social connection needs to be available.”

Cause

Lock has a limitation of 50 database connections enabled per client. If the connection requested in the /authorize call is not returned Lock’s check for allowed connections, the error will occur.

Solution

If you are using the Lock SDK, it has a limit of 50 database connections per application, which is documented here:

When your application has more than 50 database connections enabled, if the connection you have requested cannot be found in the first 50 that are returned by Lock’s lookup, this error will occur.

As a workaround, provided that you always send the connection query string parameter in your authorize requests, we recommend either moving to the New Universal Login experience, which does not have this limitation, or using a different SDK like Auth0.js to build a UI from scratch for your custom Classic Universal Login page. This limitation is only present within the Lock SDK.