Stytch oauth with Google automatically logged in

When I register a user with Gmail using oauth and navigate to Home Screen. Now I will start the app again and click on “Login with Gmail” again then it will directly logged in to application instead of showing me for other Gmail accounts. How can we restrict this auto login

Hey Sandip,

Thanks so much for posting!

To clarify, is there only one Google account associated with the device during this flow? It looks like you’re using our iOS SDK, is that correct?

At the moment, if a user is already logged into a Google account on an iOS device and there is only one Google account stored on the device, that user won’t be prompted to select an account during the OAuth flow if they’re already in a logged in state. Does this match what you’re seeing?

For context, the way around this would be to pass in the select_account value in the prompt parameter during the Google OAuth flow, but this currently isn’t supported via our OAuth Start endpoint - sorry about that! I’ve added a +1 to our existing feature request to support this parameter on your behalf.

Hi Matt
Thanks for your response.

Yes we are using Stytch SDK for iOS. In your answer you mentioned that on device I have login with one Google account. Now I have logout from application and re-login again with Google Account than no any option display for Adding another account / choose another account through google. It’s directly logged in into the app.

The Link you mentioned for select account value in the prompt parameter how will use that with Stytch SDK.

Hey Sandip,

In your answer you mentioned that on device I have login with one Google account. Now I have logout from application and re-login again with Google Account than no any option display for Adding another account / choose another account in through google. It’s directly logged in into the app

Got it!

This is currently expected behavior - iOS shares Google logins across the device, so once you’ve signed in to a Google account within your application, it will be remembered on the iOS device. If you’re logged into a Google account on the device, and the device is only aware of one Google account (which you’re logged into), the Google OAuth flow will not prompt for account selection by default, and will automatically log in.

The Link you mentioned for select account value in the prompt parameter how will use that with Stytch SDK.

To clarify, the select_account parameter isn’t currently supported via our OAuth Start endpoint today. This is definitely a feature that has been requested before, so I’ve added a +1 to that request internally on your behalf and passed along your feedback to our product team!

I’m not currently aware of a workaround for this behavior, but will let you know if we are able to find one (or when we do implement support for select_account). Please let us know if we can help with anything else in the meantime!

Thanks for your response Matt,

So is there any other way that we will allow the user to select the another gmail account for login / SignUp using iOS SDK.

Hey Sandip,

We’re unfortunately not aware of a workaround to force account selection on subsequent attempts at the moment - sorry about that. We’ll follow up here if we are able to implement support for the select_account parameter, which would resolve this.

Hey Matt, any updates here? This is preventing me from adopting stytch.

Hey Marcus, we chatted via the community Slack channel, but also posting here for future visibility!

To clarify, the select_account parameter isn’t currently supported via our OAuth Start endpoint today.

We do now support the select_account parameter in our OAuth Start endpoint! It takes just adding provider_prompt=select_account to the Google OAuth start call.

Here are the respective endpoints with the select_account parameter: