0

我正在使用 DotNetOpenAuth.dll 来获取用户 ID,但我不知道如何发送 google 需要的签名 OAuth 请求:

http://code.google.com/intl/it-IT/chrome/webstore/docs/check_for_payment.html

该示例仅显示 java 代码

谢谢你的帮助

4

1 回答 1

0

访问http://www.dotnetopenauth.net/并阅读文档,您应该可以在那里找到所需的一切。

编辑:我不确定这是否正确,但这里有一些 c# 中的示例代码

var serviceProvider = new ServiceProviderDescription();
var tokenManager = new TokenManager(); //make an implementation of IConsumerTokenManager
var oauth = new WebConsumer(serviceProvider, tokenManager); //instanciate an consumer
var user = new User(); //User class contains an implementation of getFederatedIdentity()
var url = new Uri(string.Format(SERVER_URL,APP_ID,HttpUtility.HtmlEncode(user.getFederatedIdentity())));//create the url
var response = oauth.PrepareAuthorizedRequestAndSend(
    new MessageReceivingEndpoint(url, HttpDeliveryMethods.AuthorizationHeaderRequest), TOKEN); //Send the request
//do what you want with the response
于 2011-10-30T07:47:56.390 回答