简体   繁体   中英

Sign in with google prevents the user to sign in again with different account - iOS

I'm using google authentication to sign in with firebase. The authentication process works well and I'm able to create the credentials and authenticate.

My problem is when, after signing out from firebase and google, the user tries to sign in using google again. At this point google will automatically authenticate with the account used previously. I tried both sign-out and disconnect option from google api but the result is the same.

I partially found what my problem was, here steps to reproduce:

  1. Not signed in with google in app and not signed-in in safari on the device with a google account
  2. Sign in with the application using a google account
  3. Now I am signed-in in app AND in safari as well with the same account
  4. When I sign-out from the application, safari is still authenticated with this user
  5. I'm not able to see the account choice in app until I sign-out the google account from safari on the device

This problem doesn't show up if safari (point 1) was already signed-in with a different google account. In this case I will always have a choice between the two accounts in app.

Is there a way to sign out from the app and always shows the account choice when signing in with google again?

There are many Authentication URI parameters. One of them is "prompt" which could have a "select_account" value. It helped me to resolve the same issue for Auth0-service Google integration. Maybe could be useful for your issue if the SDK allows setting parameters for sign in. See docs here: https://developers.google.com/identity/protocols/OpenIDConnect#authenticationuriparameters

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM