如何查看域是否正在使用 Google 具有 Python 的应用程序

How to see if domain is using Google Apps with Python

在我的 Python GAE 应用程序中,我需要知道用户的域是否是 Google Apps 域。到目前为止,我一直在向 https://www.google.com/a/domainName/ServiceLogin 发送请求。如果响应包含 "Sorry, you've reached a login page for a domain that isn't using Google Apps",则该域未使用 Google 应用程序。然而,最近我发现这种方法似乎不再奏效了。是否存在任何替代方法?

谢谢

在您向用户请求的范围列表中包含 email。如果是 Google Apps 帐户,response token 中会有一个 hd 参数。