Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allowing multiple accounts when signing in with Google+

For my app, I followed the example on this page to sign in using Google+, but it signs the user in and calls the signinCallback whenever the page loads. But I don't want it to sign in automatically on the page load and more importantly, I need to give the user a chance to choose between his different Google accounts.

When I log the user out using gapi.auth.signOut() and then reload the page containing this button, it still signs me in automatically. This doesn't allow the user a chance to sign in with a different google account.

The Gmail workflow seems to be to log me in automatically, but gives me an option once logged in to "Add account" which goes to this page.

But when I try to change the continue url to my service it gives me an "invalid page request" error.

like image 887
Debnath Sinha Avatar asked Aug 20 '14 12:08

Debnath Sinha


1 Answers

This is a bit late, but I was just looking for this answer and figured something out.

There are two options that I know of, one is to use the sign out flow. The next time the user logs in, they will be prompted to do user selection.

The second is to set data-approvalprompt to force. That will force the user selection and could be used to switch the user.

like image 98
Matt J Avatar answered Oct 14 '22 14:10

Matt J