Home Realm Discovery using Auth0.js

We’re using Auth0.js to create a custom login page for our web app, not using Lock. At the moment, users log in by either entering their username and password or via a social provider.

We’re looking to expand this to support enterprise connections as well. My understanding is that when using the Lock, it will ask the user for their email, and select the correct connection based on matching the email address to that configured under the specific connection (home realm discovery).

I was wondering if there was any way to achieve HRD using the Auth0.js API?

Hi Nadim.

All the logic for HRD is built into Lock, it’s not part of Auth0.js. So, if you want HRD with Auth0, you’ll have to build it yourself.

You’ll need to keep a list of associations between domains and connections or devise some other way to know the right connection name and, once you have it, do an authorize() request with connection: "<the_connection_name>" in the options (like with social providers).