【问题标题】:Is there anyway to check whether the google account that user integrated is a Google workspace account(Gsuite) or normal account?无论如何检查用户集成的谷歌帐户是谷歌工作区帐户(Gsuite)还是普通帐户?
【发布时间】:2021-12-21 01:18:46
【问题描述】:

我正在尝试创建一个使用 google 日历 api 并且可以阻止组织中所有人日历上的日期的应用程序,为此我需要与组织的 google 工作区帐户集成,我想添加一个检查以便用户必须仅与 G Suite 帐户集成。但是我无法找到集成的帐户是google workspace(G套件)还是普通帐户。

【问题讨论】:

    标签: google-api google-oauth integration


    【解决方案1】:

    要将登录限制为您自己组织的 Cloud Identity 或 Workspace 帐户的用户,您可以set the OAuth consent screen to internal

    或者,您可以请求范围openid email 并检查hd claim in the resulting ID Token。此声明包含用户的 Cloud Identity/Workspace 帐户的主域名。如果缺少声明,则它是消费者帐户。

    【讨论】:

    • 谢谢,但是我需要知道用户集成的谷歌账户是否是管理员账户,因为如果不是谷歌工作区管理员账户,我将无法访问该域下其他用户的日历。使用 userProfile 和电子邮件范围了解帐户是否为管理员的任何解决方案
    【解决方案2】:

    请浏览此文档一次。 Who is my adminstrator.

    因此,据我所知,无法获得 Gsuite 的管理员。 如果我错了,请纠正我。

    【讨论】:

      猜你喜欢
      • 2015-01-10
      • 1970-01-01
      • 2016-12-07
      • 1970-01-01
      • 2016-09-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多