【问题标题】:How to log out of a chrome.identity oauth2.0 token [duplicate]如何注销 chrome.identity oauth2.0 令牌 [重复]
【发布时间】:2018-09-11 13:03:47
【问题描述】:

我正在使用带有 chrome.identity.removeCachedAuthToken() 的 Google Oauth。我可以登录用户,但不能使用 removeCachedAuthToken() 注销。

 chrome.identity.removeCachedAuthToken({ token: current_token },
        function() {});
      var xhr = new XMLHttpRequest();
      xhr.open('GET', 'https://accounts.google.com/o/oauth2/revoke?token=' +current_token);
      xhr.send();

有没有办法清除chrome.identity插件的登录状态?

【问题讨论】:

    标签: javascript google-chrome-extension oauth-2.0


    【解决方案1】:

    我认为你只需要那个

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

    );

    【讨论】:

    • 这里的 responseCallback() 方法是什么?
    • 这是您为回调函数创建的用于重定向 ex 的方法
    • 你能给我举个例子吗
    • 你可以评论一下
    • 如果你想对它们做点什么,你只需检查响应 JSON attr
    猜你喜欢
    • 2020-09-04
    • 2014-11-22
    • 1970-01-01
    • 2017-10-10
    • 2016-10-23
    • 2021-02-09
    • 2014-02-14
    • 2020-02-20
    • 2022-06-12
    相关资源
    最近更新 更多