Set a default/fallback enterprise connection for all unrecognized emails

Specifically, I’m trying to create an enterprise connection that will be used if no other connection is found to support a specific domain.

For example, we have 2 enterprise connections:

  • ad-1: supports the domains @domainA.com and @domainB.com.

  • ad-2: supports all other domains.

How can I get this setup using the Lock widget? I tried to set the “defaultEnterpriseConnection” property to ad-2 but when I try to enter an email address that isn’t supported by ad-2, I get an error that says “Please use your corporate email to login.”.

I know I could add all the individual domains to ad-2, but it would be great if I can get away from having to add to that every time we add new users to that AD.

Hey @omar.dfin, there’s no built-in way in the connections to do this, but you can play around Lock’s connectionResolver hook and see if you can implement the logic there: GitHub - auth0/lock: Auth0's signin solution

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.