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

前端 未结 8 1984
一生所求
一生所求 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:17

    I am not aware about the specific third party provider. But I faced the similar problem when using Google Oauth with chrome.identity.launchWebAuthFlow(). I could sign in the user, but not sign out using removeCachedAuthToken()

    In this case, to logout the user, I used chrome.identity.launchWebAuthFlow() with Google's logout URL rather than it's oauth URL

    chrome.identity.launchWebAuthFlow(
        { 'url': 'https://accounts.google.com/logout' },
        function(tokenUrl) {
            responseCallback();
        }
    );
    

    This worked pretty well.

提交回复
热议问题