2011-07-22 37 views

回答

7

我们可以通过使请求的范围令牌就像得到谷歌的电子邮件地址不仅没有联系人:

"https://www.google.com/accounts/OAuthGetRequestToken?scope=https://www.googleapis.com/auth/userinfo#email"; 

现在做一个授权的呼叫来得到这样的回应:

var responseText = oAuthConsumer.GetUserInfo("https://www.googleapis.com/userinfo/email", consumerKey, consumerSecret, token, tokenSecret); 

这里通过称授权调用意味着在头中创建带有所需参数的HTTP Get请求。

头字符串应该包含:境界,consumerKey,是SignatureMethod,签名,时间戳,nounce,OAuthVersion,令牌

请参考http://googlecodesamples.com/oauth_playground来验证你的代码,看到正确的标题字符串参数

相关问题