Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

chrome.identity.launchWebAuthFlow logout/switch user

I make users login to my chrome extension through my own OAuth2 API which uses google signin, through chrome.identity.launchWebAuthFlow with interactive set to true, and it works fine, user is prompted to sign in with google account, I get redirect url in my extension's background script, parse access token from it and everything is fine until I need to logout this user and make it possible to sign with other account. When I try running chrome.identity.launchWebAuthFlow with interactive set to true again, nothing pops up, but redirect url is returned in background and access token is picked up for previously logged in user, so I'm unable to make my users switch account.

Is there any solution for this?

like image 777
kecman Avatar asked Apr 20 '18 03:04

kecman


1 Answers

I haven't used chrome.identity.launchWebAuthFlow, but I think your question is similar to "How do I log out of a chrome.identity oauth provider".

Among the answers:

  • use launchWebAuthFlow with the logout url https://accounts.google.com/logout
  • revoking the token with https://accounts.google.com/o/oauth2/revoke?token=TOKEN
  • Adding &prompt=select_account into the url

As I said, I haven't used launchWebAuthFlow yet, but I wanted to help by showing you an already answered question

like image 50
MagnetPlant Avatar answered Oct 18 '22 01:10

MagnetPlant