使用Google登录:如何自定义请求的权限

Dav*_*ain 6 authentication google-app-engine google-oauth

我想了解如何配置应用引擎应用以请求自定义权限.以下示例要求"管理部署在Google App Engine上的应用程序".他们是怎么解决这个问题的?

来自cloudbees注册的截图

Ezr*_*zra 5

概述:

应用程序用于登录的方法是OAuth。该框中显示的内容由示波器控制。

OAuth范围的目的是访问有关经过身份验证的用户的信息。每个应用程序的范围都不同,并确定授予应用程序访问权限的有关用户的哪些信息。

以下资源可能值得一试:

OAuth的维基百科不是很大,但可能会根据您的了解是有益的。

通常,您打算使用的每个API的文档都会提供有关哪些可用范围以及应该使用哪些范围的信息。


详细:

具体来说,一个OAuth请求的范围参数为

https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile

登录时将向用户显示类似于以下内容的提示:

+ View basic information about your account
    * View your name, public profile URL, and photo
    * View your gender and birthdate
    * View your country, language, and timezone
+ View your email address
    * View the email address associated with your account
Run Code Online (Sandbox Code Playgroud)

虽然只有一个https://www.googleapis.com/auth/userinfo.email会显示类似以下内容:

+ View your email address
    * View the email address associated with your account
Run Code Online (Sandbox Code Playgroud)

您可以根据需要用户的信息来自定义范围。