If I log in from my local host environment which is compiled with the auth0.WebAuth object looking like this:
auth0 = new auth0.WebAuth({
clientID: 'adscsdcascascascasdcsdac',
domain: 'webatom.auth0.com',
responseType: 'token id_token',
audience: 'https://api.webatom.com',
redirectUri: 'http://localhost:5000/callback',
scope: 'openid profile'
});
I want it to redirect the developer to the localhost.
If I log in (or the user logs in) from the production environemnt ie. from jtrade.pro I want them to be redirected to jtrade.pro/callback. Obviously the object in the production version looks like this (with a different redirect uri):
auth0 = new auth0.WebAuth({
clientID: 'adscsdcascascascasdcsdac',
domain: 'webatom.auth0.com',
responseType: 'token id_token',
audience: 'https://api.webatom.com',
redirectUri: 'http://jtrade.pro/callback',
scope: 'openid profile'
});
As far as I understood, thats how you do it. Pass the uri and you will be redirected to the required page if the uri is whitelisted and comma separated in the client settings. Beautifull, I whitelisted and comma separated.
Last step, the hosted page.
var lock = new Auth0Lock(config.clientID, config.auth0Domain, {
auth: {
redirectUrl: config.callbackURL,
responseType: 'token',
params: config.internalOptions
}
Redirect URL is set to config.callbackURL which is as far as I understood makes auth0 look into the whitelist and see if one of the provided uri is there and redirect the user if it is.
However, this doesn’t happen. Auth0 only redirects the user to the first uri in the whitelist. I can’t find a suitable solution for this issue. Hopefully someone ran into this situation as well.