【问题标题】:Difference between profile and email scope in Google OAuth 2 flowGoogle OAuth 2 流程中配置文件和电子邮件范围之间的区别
【发布时间】:2018-05-21 14:21:03
【问题描述】:

我正在配置我的应用程序访问 Google 所需的范围,但我找不到这两者之间的区别:

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

在文档中我们可以看到以下内容:

https://www.googleapis.com/auth/userinfo.email查看您的电子邮件地址 https://www.googleapis.com/auth/userinfo.profile查看你的基本资料

但是,当我通过api-client-library 访问用户信息时,即使我没有请求其中一个范围,我也会获得所有信息。

com.google.api.services.oauth2.Oauth2#userinfo

返回完整的对象。如果我不使用电子邮件范围,则仍会返回电子邮件。但是,如果我不使用这两个范围 - 访问受到限制并且调用失败。问题是这两种作用域有什么区别,哪一种更可取?

【问题讨论】:

    标签: java google-api google-oauth google-oauth-java-client


    【解决方案1】:

    https://developers.google.com/identity/protocols/oauth2/scopes#google-sign-in

    Google 登录范围

    个人资料:查看您的基本个人资料信息。

    电子邮件:查看您的电子邮件地址。

    openid:使用 OpenID Connect 进行身份验证。

    基本资料:ID、全名、名字、姓氏、图片网址。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-01-11
      • 2013-04-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-06
      • 1970-01-01
      • 2016-12-02
      相关资源
      最近更新 更多