要求 Google 返回电子邮件地址作为 OAuth 的一部分 [英] Require Google to return email address as part of OAuth

查看:29
本文介绍了要求 Google 返回电子邮件地址作为 OAuth 的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 OAuth 通过 dotNetOAuth 访问 Gmail.授权后如何强制谷歌返回用户的电子邮件地址作为回调的一部分?

I am using OAuth to access Gmail with dotNetOAuth. How can I force Google to return user's email address as part of callback after authorization?

默认情况下,Google OAuth 回调仅返回令牌密钥和访问令牌.

By default, Google OAuth callback only returns the token secret and access tokens.

推荐答案

OAuth 没有在 OAuth 握手期间提供额外参数的工具,所以我认为你不能强迫 Google 提供它.但是,可能有一个 Google API,您可以使用您的 OAuth 访问令牌在握手后调用以获取电子邮件地址.

OAuth doesn't provide a facility for extra parameters during an OAuth handshake, so I don't think you can force Google to supply it. There is likely a Google API however that you can use your OAuth access token to call to fetch the email address after the handshake, however.

这篇关于要求 Google 返回电子邮件地址作为 OAuth 的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆