【问题标题】:Google Gmail API - AuthGoogle Gmail API - 身份验证
【发布时间】:2011-12-16 05:40:36
【问题描述】:

我已经有可以正常工作的代码,但出于安全原因,我想采用其他方式进行身份验证。

在这种情况下,用户写了他的用户名和密码,但我想制作像“允许 demo.com 访问您的信息”的点击按钮。

如何更改此代码:

//Provide Login Information
Google.GData.Client.RequestSettings rsLoginInfo = new Google.GData.Client
        .RequestSettings("", txtEmail.Text, txtPassword.Text);
rsLoginInfo.AutoPaging = true;

// Fetch contacts and dislay them in ListBox
Google.Contacts.ContactsRequest cRequest = new ContactsRequest(rsLoginInfo);
Google.GData.Client.Feed<Google.Contacts.Contact> feedContacts = cRequest
        .GetContacts();
foreach (Google.Contacts.Contact gmailAddresses in feedContacts.Entries) {
    Console.WriteLine("\t" + gmailAddresses.Title);
    lstContacts.Items.Add(gmailAddresses.Title);
    foreach (EMail emailId in gmailAddresses.Emails) {
        Console.WriteLine("\t" + emailId.Address);
        lstContacts.Items.Add(" " + emailId.Address);
    }
}

【问题讨论】:

    标签: asp.net api gmail contacts


    【解决方案1】:

    您似乎正在尝试执行 3-Legged OAuth。此处记录了用于执行 3-Legged OAuth 1.0a 的 .NET 示例:

    http://code.google.com/apis/gdata/docs/auth/oauth.html#Examples

    【讨论】:

      猜你喜欢
      • 2020-07-11
      • 2018-10-25
      • 1970-01-01
      • 2019-01-27
      • 1970-01-01
      • 2015-06-11
      • 2015-07-13
      • 2018-06-29
      • 1970-01-01
      相关资源
      最近更新 更多