Passing Config to Hosted Login Page

In the hosted login page, it reads out config information supposed passed into it from the calling page.

     var config = JSON.parse(decodeURIComponent(escape(window.atob('@@config@@'))));

Try as I might, I cannot find where to pass this config object in from the calling code.

I’m using auth0-js v8. How do I pass in config data to Lock? Thanks.

If you haven’t done so already you should check the reference documentation associated with the hosted login page, in particular, the section about query string parameters. In essence, the config object is much more than just the parameters that are passed by the client application.

If you’re looking for parameters that are directly passed from the client application then the best place to try to find them would be in config.extraParams. The documentation linked above also shows the example of one parameter being passed from a client application using Auth0.js webAuth.authorize method; additional parameters could be sent in a similar manner.

Ah sweet - extraParams looks like what I’m after. In fact, that is totally what I’m wanting to do, pass display setup parameters for the LockControl from the initiating page.

Thanks @jmangelo

Ah sweet - extraParams looks like what I’m after. In fact, that is totally what I’m wanting to do, pass display setup parameters for the LockControl from the initiating page.

Thanks @jmangelo

@jmangelo how do I set some of the other Lock options from my app? For example, I want to set allowShowPassword to true. How can I do that?

1 Like