amplify-swift: Auth signOut after webUI signIn does not clear browser session

Describe the bug Amplify.Auth.signOut() does not clear the SFAuthentication session. This will not allow the user to signIn again with another users.

To Reproduce Steps to reproduce the behavior:

  1. signIn using Amplify.Auth.signInWithWebUI
  2. After successful signIn, signout the user by Amplify.Auth.signOut
  3. Now try to signIn again using Amplify.Auth.signInWithWebUI.
  4. The user is not presented a signIn screen, Amplify automatically signin the user to the previous users account.

Expected behavior After signOut Amplify.Auth.signInWithWebUI should work as a fresh start.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (3 by maintainers)

Most upvoted comments

Changes are merged to master and will be available in the next release.

this issue is closed but i am getting this issue in 1.5.0. can anyone help?

direct the user to a View or page where he/she has the option to login again, maybe using different “Login with…” providers.

@tiyberius I am really sorry that your experience with Amplify Auth has not been great. I would like to resolve that. Can you open an additional issue with all the details, i.e. Amplify Version, your configuration file redacted all the sensitive information, logs with verbose logging enabled, code snippet for recreating the issue, and any other piece of information you think applies to the issue.

Looking forward to hearing from you.

Same here. When I logout with one user and just sign in with another user (also from another team) and without a browser refresh, previous user data is loaded until a page refresh.

Hello, I just tested again with Cognito signin and I confirm the signout process works as expected. I understand from your message that you are using “Login with Google” and Google store session cookies onthe user your browser that prevents to authenticate as a different user after signout.
I think this problem is not related to Amplify, but to Login with Google.
After an application signout, your application should redirect the user to a View or page where he/she has the option to login again, maybe using different “Login with…” providers.

The issue exists to this day. When I sign out of the app and try to sign in again, I am automatically signed in with the Google account that I was signed in with before, with no option to select a different account. It seems like the Amplify.Auth.signOut() method doesn’t clear the cache at all. I’m surprised that this thread was opened almost 3 years ago and to this day no fix seems to be available.