【问题标题】:Implement sign out from google Oauth实施从谷歌 Oauth 注销
【发布时间】:2019-11-24 13:53:43
【问题描述】:

如何从 login-with-google 应用中退出。我想以这样一种方式退出,以便在再次使用谷歌登录时再次要求输入密码。 我不想从浏览器中删除帐户。 我只是想忘记我的浏览器。

【问题讨论】:

    标签: oauth oauth-2.0 google-oauth google-signin


    【解决方案1】:
    <a href="#" onclick="signOut();">Sign out</a>
    <script>
      function signOut() {
        var auth2 = gapi.auth2.getAuthInstance();
        auth2.signOut().then(function () {
          console.log('User signed out.');
        });
      }
    </script>
    

    来自官方文档https://developers.google.com/identity/sign-in/web/sign-in#sign_out_a_user

    如果您想以任何网站的用户身份退出应用程序,您可以在您帐户的安全首选项中执行此操作:https://myaccount.google.com/permissions

    【讨论】:

      猜你喜欢
      • 2013-05-07
      • 2014-10-20
      • 1970-01-01
      • 1970-01-01
      • 2018-07-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-16
      • 1970-01-01
      相关资源
      最近更新 更多