Login_hint not working with loginWithRedirect and Universal Login

We must use the Universal Login because we need to support organizations. I’m calling loginWithRedirect as shown below. The password is not auto-filling. I have tried the advice mentioned here but it appears that when I toggle the “Customize Login Page” button it enables classic login (instead of universal). Then when the app redirects I get an error message that classic login does not support organizations. Is there a way to auto-populate the email field while still using the universal login?

const options = {
    authorizationParams: { organization: organizationId },
    login_hint: email@email.com
};
auth0.loginWithRedirect(options);

Hi @capndave

Thank you for posting your question on the Auth0 Community!

I am a little bit confused from your post, currently do you have issues in auto-filling the email or password field?

As I can see in the code provided , if you pass the login_hint in the parameters of the redirect url, the email address should be filled in, as seen in the example below:

https://[Tenant].auth0.com/authorize?client_id=[Client ID]&response_type=token%20id_token&redirect_uri=https://jwt.io&scope=openid&login_hint=user1@gmail.com&state=1234&nonce=5678```

However, if you are having issues with auto-filling the password, I believe that feature is not available at this time while using the Universal Login and only the prefill option would do the trick which is only available for Classing Login.

You might want to look into Password Autocomplete in our documentation which I believe suits your use case.

If you have any extra questions on the matter, feel free to leave a reply.

Kind Regards,
Nik

Hi Nik. We’re just trying to auto-fill the email field. In my original post, does the options object we’re passing to the loginWithRedirect method look correct?

Hi @capndave

Your loginWithRedirect method looks fine. If the email field is not being auto-filled, you can try the following:

const options = {
    authorizationParams: { 
    organization: organizationId,
    login_hint: email@email.com
    }
};
auth0.loginWithRedirect(options);

The issue might be that the login_hint is a parameter used for authorizationParams and not part of the options used for loginWithRedirect().

loginWithRedirect() option’s uses the RedirectLoginOptions parameters which are:

interface RedirectLoginOptions<TAppState> {
    appState?: TAppState;
    authorizationParams?: AuthorizationParams;
    fragment?: string;
    openUrl?: ((url) => void | Promise<void>);
}

However, I believe both of these should work in your use case.

Please let me know if you have any other questions or still having difficulties with the email auto-fill.

Kind Regards,
Nik