How to use Auth0.js to emulate the behavior of lock to dynamically inject social buttons based on the application?

Question: How to use Auth0.js to emulate the behavior of lock to dynamically inject social buttons based on the application?

Answer:
Unfortunately, because there is no documentation on the process of handling such a flow. The best way to do so would be to reverse engineer the behavior of Lock by looking at the way Lock makes these calls in the authorization request.

In the authorization request, Lock uses the Auth0.setClient({ }) function to initialize the UI for the login page. It holds pertinent information such as the client_id, tenant, and associated connections. Which then draws the social buttons on the page.

To do so, you will have to include the Auth0 CDN and implement the Auth0.setClient({}) function to emulate the same behavior as Lock in your application.

You will have to use this CDN with your implementation:
https://cdn.auth0.com/client/{client_id}.js?{timestamp for browser}

1 Like