Google OAuth returns 空 Family/Given 名称

Google OAuth returns empty Family/Given name

我正在为用户注册 Google OAuth(asp mvc 应用程序),我想在他们授权我的应用程序后检索用户的姓氏和名字,但是如果用户没有 enable/join Google Plus,回调 api return 我空姓和名,如果使用 Google Plus 启用,然后我可以获得他们的 family/given 个名字, 所以,这是我的问题,是否可以通过 OAuth 获取 google 用户的 family/given 名称,而无需用户启用 Google Plus?

 var loginInfo = new ExternalLoginInfo();
 loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();

LoginInfo 有 family/given 个名称属性,但它们是空字符串。

非常感谢!

很高兴我现在得到了解决方案,解决方案是将请求中的特定范围(https://www.googleapis.com/auth/plus.login)添加到 google oauth,然后如果用户的 google 帐户没有未启用 google plus,它会提示用户先创建 google plus 配置文件,然后接受您的应用程序以访问用户的 google account/plus 信息。

google oauth 参考:https://developers.google.com/+/web/api/rest/oauth