谷歌联系人API asp.net设置和授权令牌 [英] Google Contacts API asp.net settings and authorization token

查看:274
本文介绍了谷歌联系人API asp.net设置和授权令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有说明如何填写申请设置请求生成的设置?任何好的例子

Is there any good example that shows how to fill the application settings creating the settings for request?

这是code从谷歌

using Google.Contacts;
using Google.GData.Contacts;
using Google.GData.Client;
using Google.GData.Extensions;
// ...
    RequestSettings settings = new RequestSettings("<var>YOUR_APPLICATION_NAME</var>");
    // Add authorization token.
    // 
    // ...
    ContactsRequest cr = new ContactsRequest(settings);

我是否可以指定我从的OAuth请求获得令牌,并没有更多的?

Do I have to specify the token that I get from oAuth request, and no more?

有关YOUR_APPLICATION_NAME的值可以是任意的字符串值?

The value for YOUR_APPLICATION_NAME could be any string value?

推荐答案

如果你想使用OAuth 2.0,您必须设置 settings.OAuth2Parameters 来的一个实例 OAuth2Parameters 类或使用 RequestSettings(字符串的applicationName,OAuth2Parameters参数)构造。

If you want to use OAuth 2.0 you have to set settings.OAuth2Parameters to an instance of the OAuth2Parameters class or use the RequestSettings(string applicationName, OAuth2Parameters parameters) constructor.

在<一个示例应用程序href=\"http://$c$c.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/oauth2_sample/oauth2demo.cs\" rel=\"nofollow\">http://$c$c.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/oauth2_sample/oauth2demo.cs展示了如何实例化一个 OAuth2Parameters 对象。

The sample application at http://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/oauth2_sample/oauth2demo.cs shows how to instantiate a OAuth2Parameters object.

其他 RequestSettings 构造允许您使用OAuth 1.0和其他身份验证机制。

Other RequestSettings constructors allow you to use OAuth 1.0 and other authentication mechanisms.

这篇关于谷歌联系人API asp.net设置和授权令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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