我已经引用了这个帖子 Google Authentication Process ,这与我的问题并不完全相似,但我使用的代码是相似的。
using System;
using DotNetOpenAuth.OAuth2;
using Google.Apis.Authentication.OAuth2;
using Google.Apis.Authentication.OAuth2.DotNetOpenAuth;
using Google.Apis.Samples.Helper;
private void Window_Initialized(object sender, EventArgs e)
{
var provider = new NativeApplicationClient(GoogleAuthenticationServer.Description);
provider.ClientIdentifier = "<My Client Id here>";
provider.ClientSecret = "<My Client Secret here";
...
...
}
我的问题既不是
provider.ClientIdentifier
也不是 provider.Secret
正在得到解决。我指的是 DotNetOpenAuth 版本 4.0.0.11165 和 Google API 版本 v201306。我的目标是从不同的帐户获取 Google Analytic 数据,但在此之前我需要对用户进行身份验证,Google 可以通过提供 Access_Token 允许他离线访问!
请让我知道我做错了什么。
问候,
苏布拉塔
最佳答案
您正在构建什么类型的应用程序(Web、服务帐户、已安装的应用程序)?您获取 oath token 的方式会根据它是什么类型的应用程序而有所不同。
关于google-analytics - NativeApplicationClient.ClientIdentifier 未解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18436099/