How do I log out of a chrome.identity oauth provider

前端 未结 8 1964
一生所求
一生所求 2020-12-01 16:52

I\'m using chrome.identity to log into a 3rd party oauth provider in an chrome extension. It works fine for logging in- when I use launchWebAuthFlow I am presented with the

相关标签:
8条回答
  • 2020-12-01 17:26

    You can clear the identity cache using the chrome.identity.removeCachedAuthToken(object details, function callback) method.
    https://developer.chrome.com/apps/identity#method-removeCachedAuthToken

    0 讨论(0)
  • 2020-12-01 17:27

    If you try launchWebAuthFlow to logout but get User interaction required error, then you need to add one more flag along with the url:

    chrome.identity.launchWebAuthFlow (
      {'url': 'https://some-logout-url/',
       'interactive': true },
       function(result) {
         console.log(result);
       }
    );
    
    0 讨论(0)
提交回复
热议问题