如何验证我的Google网上应用店应用程序是否使用asp.net获得许可?

时间:2011-10-30 07:35:24

标签: asp.net oauth dotnetopenauth chrome-web-store

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

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

示例仅显示java代码

感谢您的帮助

1 个答案:

答案 0 :(得分: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