1

Our application is using gapi.auth.signin for authentication. The problem is that the account selection drop down list is not presented when user is logged into multiple accounts. Currently, to overcome this the app sets approvalprompt = force, cookiepolicy = url/single_host_origin. Obviously, this is not very efficient.

  1. Is it possible to display multi-user selection drop down list when using gapi.auth.signin?
  2. Shall gapi.auth.authorize be used instead? (Related question)

Thank you.

Community
  • 1
  • 1

1 Answers1

0

Google+ Sign-In uses a mechanism that detects when a user has already authorized a Google account. In order to prompt the user to sign in and not automatically sign the user in, you can call gapi.auth.signout from the JavaScript client as demonstrated here:

http://wheresgus.com/signindemo

However, on Sign in, the currently active Google account will be automatically signed in. Please comment on the Google+ issue tracker, this might be a bug.

class
  • 8,621
  • 29
  • 30
  • We call gapi.auth.signout when users sign out and even before users login. Unfortunately, it does not help. – user3276651 Apr 24 '14 at 01:09
  • Try it now, I'm seeing multiple account access working from my demo page. There may still be issues with iOS. – class Apr 24 '14 at 02:12
  • I'm running into this now as well. When I go to my demo, it auto logs me in with my main gmail account, but I need the ability to select an account. If I run logout, the method fires ok, but on reload, I still auto login with the account I'm using in GMail. I can't get to an account selection screen - ever - unless I use force, which is bad as it makes people re-authorized the entire app. – Raymond Camden Apr 25 '14 at 03:05
  • Raymond, if you are running on localhost, the cookie will not be able to get set, make sure you're running on a site on the web as described here: http://stackoverflow.com/questions/20835004/google-signin-using-google-java-script-client-library/20848978#20848978 – class Apr 28 '14 at 16:27