I’m new to web development and working on a Chrome extension which links up to your Google account using OAuth2. I’m using the following code to get an auth token for the current user:
chrome.identity.getAuthToken({ interactive: true }, function (token) {
// do some stuff
});
when I ran this code, it brought me to a login screen where I was able to log in with my Google account. Now when I call this, I get a valid token.
However, now I want to test the login flow as if I was a user logging in for the first time. From the Chrome docs, I tried running:
chrome.identity.clearAllCachedAuthTokens();
But that didn’t seem to make a difference. I also tried running:
chrome.identity.getAuthToken({ interactive: true }, function (token) {
chrome.identity.removeCachedAuthToken({ token: token }, function (){})
And that didn’t work either. I also opened the extension in incognito mode but was still able to get the auth token instead of a login screen.
How can I “unauthenticate” or “log out” so that I can go through the auth flow again?
