【问题标题】:How to Customize the Google oauth authorization error window如何自定义 Google oauth 授权错误窗口
【发布时间】:2019-12-08 01:12:46
【问题描述】:

我使用 google Oauth 登录。访问正确的帐户将得到很好的实施。但是,如果方法不正确,则会出现错误窗口。

喜欢这个

'授权错误 错误 403:org_internal 此客户端仅限于其组织内的用户。'

我想自定义那个窗口。

我尝试像这样包含 alert('error')。

gauth.signIn({
            scope : 'https://www.googleapis.com/auth/gmail.send'
          }).then(function(){
              checkLoginStatus();
          },function(){
              alert('error');
          });

但是,它出现在出现错误窗口之后。 我想隐藏错误窗口。

【问题讨论】:

    标签: javascript php jquery ajax google-signin


    【解决方案1】:

    我不知道您所说的“它出现在出现的错误窗口之后。我想隐藏错误窗口”。您的问题听起来像是一般的 JavaScript 问题,而不是特定于 Google 登录的问题。

    但是,根据我在您的问题中读到的内容,我想您希望将您的客户限制在组织内。在这种情况下,您可以添加hosted_domain 来限制组织。或者,如果您已经知道用于登录的用户电子邮件地址,请使用 login_hint 指定用户名。

    您可以在此处找到这些选项: https://developers.google.com/identity/sign-in/web/reference#gapiauth2clientconfig

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2012-07-14
      • 2021-10-14
      • 2013-07-31
      • 2020-01-12
      • 1970-01-01
      • 2015-08-09
      • 2017-01-11
      相关资源
      最近更新 更多