google-api-dotnet-client

How to retrieve Google calendar entries using service account and.NET

最后都变了- 提交于 2020-01-06 13:53:30
问题 I am getting the following error when using a service account + impersonation to retrieve Google calendar entries: Error:"access_denied", Description:"", Uri:"" I can create events using both user and service account flow (no impersonation). I can retrieve calendars using both user and service account flow (with and without impersonation). I can retrieve calendar events with only user flow. On a related matter, I noticed that using the oAuth2 user flow the returned events include those that I

Google API to upload files using the Authentication Service Account

邮差的信 提交于 2020-01-06 04:04:06
问题 I'm trying to send files by API Google Drive, though, I can not find any documentation on how to perform C # Uploading files using the Authentication Service Account. I downloaded the Daimto library, however, he uploads using the DriveService class, when we use the authentication ClientId and ClientSecret. But using authentication for account service he returns to PlusService class, and found no way to upload files this way. Can someone help me? Best regards Using Authentication Service

GoogleWebAuthorizationBroker.AuthorizeAsync() hangs if browser closed

自闭症网瘾萝莉.ら 提交于 2020-01-04 05:58:26
问题 I'm writing a C# desktop app that can copy its output to a users Google Drive. However when I try an authorise access to Google with GoogleWebAuthorizationBroker.AuthorizeAsync() if the user closes the authentication page in the browser the method never returns! Even if I use a 30 sec cancellation token it never returns if the browser is closed. public bool Authorise() { _authorised = false; UserCredential credential = null; try { // here is where we Request the user to give us access, or use

NativeApplicationClient and OAuth2Authenticator not resolved

可紊 提交于 2020-01-04 03:29:04
问题 I am writing a Console Application to download data from BigQuery. Once again, the .NET library is vague and confusing. In this question, two Google employees have posted a response and neither of the responses is working on my machine because they haven't quite made it clear which references they are using. I paste the code once again and elaborate: using DotNetOpenAuth.OAuth2; using Google.Apis.Authentication.OAuth2; using Google.Apis.Authentication.OAuth2.DotNetOpenAuth; using Google.Apis

NativeApplicationClient and OAuth2Authenticator not resolved

点点圈 提交于 2020-01-04 03:28:20
问题 I am writing a Console Application to download data from BigQuery. Once again, the .NET library is vague and confusing. In this question, two Google employees have posted a response and neither of the responses is working on my machine because they haven't quite made it clear which references they are using. I paste the code once again and elaborate: using DotNetOpenAuth.OAuth2; using Google.Apis.Authentication.OAuth2; using Google.Apis.Authentication.OAuth2.DotNetOpenAuth; using Google.Apis

get Google Credential throws Unhandled Exception

前提是你 提交于 2020-01-02 16:18:06
问题 On My Xamarin.forms Portable Project, I am trying to read information from google sheet: using (var stream = this.Assets.Open(@"clientsecret.json")) { var secrets = GoogleClientSecrets.Load(stream).Secrets; //I get the secrets correctly credential = GoogleWebAuthorizationBroker.AuthorizeAsync( secrets, Scopes, "user", CancellationToken.None, new FileDataStore(credPath,true)).Result; } I get Unhandled Exception System.AggregateException: One or more errors occurred. when the complier trying to

How to append “&login_hint=user@gmail.com” to GoogleWebAuthorizationBroker

只谈情不闲聊 提交于 2020-01-02 05:38:06
问题 I want to append the login_hint to an authentication request to Google. I'm using the following code: FileDataStore fDS = new FileDataStore(Logger.Folder, true); GoogleClientSecrets clientSecrets = GoogleClientSecrets.Load(stream); credential = GoogleWebAuthorizationBroker.AuthorizeAsync( clientSecrets.Secrets, scopes.ToArray(), username, CancellationToken.None, fDS). Result; var initializer = new Google.Apis.Services.BaseClientService.Initializer(); initializer.HttpClientInitializer =

Google Calendar API Authentication .NET browser window

二次信任 提交于 2020-01-01 16:51:51
问题 I am using the latest version of the Google .NET Client API (v1.81). I am trying to connect to the Calendar Service using the following code var calendarService = new CalendarService(new BaseClientService.Initializer { HttpClientInitializer = GetCredential(), ApplicationName = "MyApp" }); public UserCredential GetCredential() { UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync( new ClientSecrets { ClientId = _clientId, ClientSecret = _clientSecret }, new[] {

Google API BatchRequest: An established connection was aborted by the software in your host machine

时光怂恿深爱的人放手 提交于 2019-12-25 14:22:31
问题 I'm testing Google BatchRequest (C#) of InsertAllRequest. once a batch reaches more than 60 requests (~30,000 bigquery table rows / > 10,880,366 Http ContentLength in total), Exceptions happens as below. It's the same when I turned off my firewall. Solutions I found online such as turn http keep-alive off doesn't work in this case because I don't have controls on how the API uses the HttpClient. System.Net.Http.HttpRequestException: Error while copying content to a stream. ---> System.IO

Google API BatchRequest: An established connection was aborted by the software in your host machine

佐手、 提交于 2019-12-25 14:22:10
问题 I'm testing Google BatchRequest (C#) of InsertAllRequest. once a batch reaches more than 60 requests (~30,000 bigquery table rows / > 10,880,366 Http ContentLength in total), Exceptions happens as below. It's the same when I turned off my firewall. Solutions I found online such as turn http keep-alive off doesn't work in this case because I don't have controls on how the API uses the HttpClient. System.Net.Http.HttpRequestException: Error while copying content to a stream. ---> System.IO