要求Google作为OAuth的一部分返回电子邮件地址 [英] Require Google to return email address as part of OAuth
问题描述
我正在使用OAuth通过dotNetOAuth访问Gmail。授权后,如何强制Google在回调中返回用户的电子邮件地址?
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屋!