These are built in features to lock, but I cannot find a direct way to do this from the auth0.js library. I have seen it recommended that you would build these features out by keeping a list of the domains and connections in the application. To do this dynamically, you would need to request that info from the management API, and you cannot do this from a client side app, meaning you would need to send this info from your backend or API. Since connections and domains are fairly static it may just be easier to set this info manually.