【发布时间】:2014-12-09 07:59:49
【问题描述】:
我想通过 google api 获取已安装应用程序的最后一个帐户活动。来自https://security.google.com/settings/security/activity的IP地址和时间等信息。有两种方法可以得到这个:从 json 和从谷歌客户端库。我发现,我必须使用 google-admin-sdk。 我找到了Gmail's Last activity 的帖子,但不明白如何使用它。 我的代码:
string[] scopes = new string[] {PlusService.Scope.PlusLogin,
PlusService.Scope.UserinfoEmail,
PlusService.Scope.UserinfoProfile};
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets
{
ClientId = "my-client-id",
ClientSecret = "my-client-secret"
},
scopes,
Environment.UserName,
CancellationToken.None
).Result;
【问题讨论】:
标签: c# google-api google-admin-sdk