I want get last account activity with google api for installed application. The information like ip address and time from https://security.google.com/settings/security/activity. There is two ways to get this: from json and from google client libryary. I find, that i mush use google-admin-sdk. I find post Gmail's Last activity , but can't understand, how to use it. My code:
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;