amazon-cognito-auth-js icon indicating copy to clipboard operation
amazon-cognito-auth-js copied to clipboard

signout function does not signout Google

Open railsstudent opened this issue 7 years ago • 20 comments

I could use the SDK to authenticate by Google account without problem. After I call signout() to sign out from web app, the google account is not really signed out. When I attempted to login again, the same google account is used for authentication while I wished to use a different google account.
What is the proper way to log out of google account such that account chooser is loaded for me to select account?
The workaround is to go to gmail.com to actually log out before returning to the app to login again. This is not a very good user experience and introduce security issue because another person can use that computer to login without typing email and address.

railsstudent avatar Jan 10 '18 08:01 railsstudent

clean cookies after signout

lucasgao avatar Jan 10 '18 16:01 lucasgao

@lucasgao is correct, browser will store the google sign in info in cookies. You need to clean cookies after sign out of your app.

yuntuowang avatar Jan 13 '18 00:01 yuntuowang

Is there api to clear cookies that store google sign in token, etc?

railsstudent avatar Jan 13 '18 01:01 railsstudent

@railsstudent Basically cognito will clear cognito cookies in browser once you click "sign out“. But google cookies won't be cleared. You may look into google API to see if there is a way.

We will look into this issue and work on it for sure!

yuntuowang avatar Jan 16 '18 23:01 yuntuowang

I created an iframe that calls https://accounts.google.com/Logout. A hack until a better solution is found.

railsstudent avatar Jan 16 '18 23:01 railsstudent

@railsstudent, awesome!

yuntuowang avatar Jan 17 '18 01:01 yuntuowang

Signing out of Cognito Auth should not sign the user out of Google. A user can be signed into Google beforehand and should stayed signed in after any Cognito logout. Correct?

bskinny avatar Mar 21 '18 03:03 bskinny

HI @bskinny, yes. Basically cognito will clear cognito cookies in browser once you click "sign out“. But google cookies won't be cleared.

yuntuowang avatar Mar 21 '18 17:03 yuntuowang

@raphadko Have you tried running the sample? Authenticating with the Google external identity provider works but perhaps using the sample application will determine if you problem is with AWS or Google configuration.

bskinny avatar Mar 31 '18 13:03 bskinny

Yes I used the sample.

raf202 avatar Mar 31 '18 15:03 raf202

I'm facing the same problem. What I need is to have the ability to switch Google Accounts. Even after user is logged out with Cognito, Google still remember the last account used to login. User end up with a login loop and have no option to select another account.

Google Sign In Web supports prompt= select_account to always show the account chooser.

I think the feature request here is to have Cognito also support adding this query parameter when landing on Google login page.

Search for select_account in Google's documentation. https://developers.google.com/identity/sign-in/web/reference#googleauthsigninoptions

howard-lin-zocdoc avatar Jun 13 '18 17:06 howard-lin-zocdoc

Hi @howard-lin-zocdoc, I get your point. Basically, since once you click sign-out, google cookie won't be cleared. So you won't be redirected to the google page to choose an account to sign in.

yuntuowang avatar Jun 13 '18 17:06 yuntuowang

@yuntuowang Yup, I think there is no way we can clear cookies under Google's domain. Can you comment on if adding prompt=select_account this is something you guys will do?

howard-lin-zocdoc avatar Jun 13 '18 17:06 howard-lin-zocdoc

I will mark this as a feature request on your behalf. For sure, it will be in our feature request queue, however I cannot comment on the delivery time of it now.

yuntuowang avatar Jun 13 '18 18:06 yuntuowang

@yuntuowang any news regarding this issue? I'm also experiencing this, users are not prompted to select the google account after they choose one for the first time.

fgrillo avatar Aug 23 '19 23:08 fgrillo

@yuntuowang Any update? If we uses Hosted UI we have option to "Sign in as different user" when using Google account.

rioastamal avatar Nov 23 '19 09:11 rioastamal

re request on your behalf. For sure, it will be in our feature request queu

@yuntuowang any update regarding this? i'm also facing this issue

NivethaMuthukumar avatar Dec 05 '19 11:12 NivethaMuthukumar

@yuntuowang any update ? i'm also facing this issue

rakesh0r avatar Dec 13 '19 04:12 rakesh0r

We are also facing the same issue. This is the usual requirement to go to prompt again for login after logout - instead of considering the same previous user. @yuntuowang: Can we make this as priority (by changing to some other instead of feature request)?

chvenkataraman avatar Feb 01 '20 16:02 chvenkataraman

@yuntuowang any updates on this? This really affects user experience. Its been 2 years now since people started reporting this. Any way to expedite this?

jorgexgb avatar Feb 04 '20 01:02 jorgexgb