Auth0- How to use lock-js and auth-js features together?

366 Views Asked by At

I am creating an app using Auth0 with Asp.net. Previously I was using lock widget but then due to some limitations I preferred creating my own custom ui using Auth0.js Now everything is working fine but I want to add some features of lock.js like multilanguage support, show/hide social login buttons connection wise etc. In lock we can do this by passing ‘ConfigurationOptions’ param in Auth0Lock object. I have read that we can use both lock and auth.js together in this article: https://auth0.com/docs/libraries/lock/v11/auth0js So is there anyway I can use lock features (language etc) with auth0.js Thanks

1

There are 1 best solutions below

0
On

What does your current setup look like? I would suggest Auth0js with Hosted Login Page. There is a whitelist of the OAuth2 parameters we can pass in the authentication request. If we want to pass the language, we could pass the following parameter in my authorization request:

webAuth.authorize({
    ...
    ui_locales: 'fr' 
},

and then in Lock, we would set the language passed like so:

= new Auth0Lock(config.clientID, config.auth0Domain, {
    ...,
    language: config.extraParams.ui_locales,
    ...
}

Let me know if this is what you are looking to do and if this helps.