How do I force the Universal Login to allow the user to select a gmail account?

Currently, on first sign-in, the user selects which Google account they want to proceed with. After that, each subsequent sign-in attempt just automatically reuses the previous selection without giving the user a chance to make a different selection.

Hi @matt15

Are you using any Auth0 provided SDK for your application implementation?

Thanks
Jeff

1 Like

Hey Jeff,

Yes I’m using the Auth0 SDK. Are you referring to the Application.kt class?

I’m relying on these imports:

import com.amazonaws.mobile.client.AWSMobileClient
import com.amazonaws.mobileconnectors.pinpoint.targeting.endpointProfile.EndpointProfileUser
import com.auth0.android.Auth0
import com.auth0.android.authentication.AuthenticationAPIClient
import com.auth0.android.authentication.AuthenticationException
import com.auth0.android.authentication.storage.CredentialsManager
import com.auth0.android.authentication.storage.CredentialsManagerException
import com.auth0.android.authentication.storage.SharedPreferencesStorage
import com.auth0.android.callback.Callback
import com.auth0.android.provider.WebAuthProvider
import com.auth0.android.result.Credentials
import com.google.android.gms.tasks.OnCompleteListener
import com.google.firebase.messaging.FirebaseMessaging

Any update @jeff0 ? Still not sure how to select a different email upon re-signin.

Hi @matt15

Apologies for the late reply. I am confirming this internally with others and get back to you in a day or two.

Thank you
Jeff

2 Likes

@jeff0 Our users are still stuck with the wrong gmail account if they happen to select the wrong one when logging in. Any update from the team?

@jeff0 are you able to follow up on that?

Hi @matt15

There is a way to trigger account selection but I am not sure if our SDK supports it. The google account selection can be forced by passing the prompt=select_account parameter on request login from google.

Please let us know if this works for you.

Thanks
Jeff

1 Like

I tried adding the parameters prompt=select_account to the WebAuthProvider.login(auth0) call but I’m still not seeing the screen to choose a google account.

I see prompt is a valid param in your docs here: Pass Parameters to Identity Providers…

Should that be working in the login call I’m making?

Looks like this issue was never resolved. We are also running into the same thing as @matt15. Users mistakenly login with the wrong Google account. We have an Action to allowlist only certain email domains. The user becomes gated from the application due to this Action, but the Universal Login screen keeps authorizing-ing them based on the same [incorrect] Google account. There is no option to change accounts.

Here’s the snippet of our Universal Login page code, where we are attempting to pass a prompt to the authorize call, as is suggested above. I don’t see this as a valid prompt in the webAuth.authorize documentation. Is there a way to do this with Universal Login?

        var params = Object.assign({
            overrides: {
                __tenant: config.auth0Tenant,
                __token_issuer: config.authorizationServer.issuer
            },
            domain: config.auth0Domain,
            clientID: config.clientID,
            redirectUri: config.callbackURL,
            responseType: 'code'
        }, config.internalOptions);

        var webAuth = new auth0.WebAuth(params);
        var captcha = webAuth.renderCaptcha(
            document.querySelector('.captcha-container')
        );

        function loginWithGoogle() {
            webAuth.authorize({
                connection: 'google-oauth2',
              	prompt: 'select_account'
            }, function (err) {
                if (err) displayError(err);
            });
        }

I ended up adding ""options":{upstream_params": {"prompt":{"value":"select_account"}}} to my connection through the management API and that allowed the prompt to do select account.

4 Likes

For anyone still wondering, I had success by setting {"prompt": "login"}. Counter-intuitively, this also works when the “screen_hint” is set to “signup”.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.