Drive with ServiceAccount hangs on first API call
See original GitHub issueHello,
I upgraded Google Drive (and all dependencies) NuGet package to the latest version 1.9.3 and from that time the Drive is not working for me. Versions from 1.6 to 1.9.2 were working fine. I’m using it in ASP.NET MVC 5 project and I’m using synchronous calls.
I’m using ServiceAccount, here it the initialiation of the driveService:
var initializer = new ServiceAccountCredential(new ServiceAccountCredential.Initializer(configuration.DriveApiClientId)
{
User = account.GetEmailAddress(),
Scopes = new[] { DriveService.Scope.Drive },
}.FromCertificate(key));
driveService = new DriveService(new BaseClientService.Initializer
{
HttpClientInitializer = initializer,
ApplicationName = "TC6",
});
When I execute first Drive API command (I tried driveService.About.Get().Execute()) I can see in the Fiddler one completed request:
POST https://accounts.google.com/o/oauth2/token HTTP/1.1
but the result of the command is never returned, it seems that there is a deadlock but I can’t find where.
Issue Analytics
- State:
- Created 8 years ago
- Comments:19
Top Results From Across the Web
Google Drive API, Oauth and service account
I've some issues with Google Drive API, service account and authentication. I read a lot, but I cannot figure out how to solve...
Read more >Service account validation | Apigee
Enable service account permission validation · Open the Google Cloud console and log in with the account you created in Step 1: Create...
Read more >Troubleshoot Config Connector
One way to do this is to temporarily stop syncing configs, wait for Config Connector to finish reconciling the resource, and then update...
Read more >Getting started with Fleet Engine | Fleet Performance
You create a DeliveryVehicle object using: The Project ID of the Google Cloud project that contains the service account used to call the...
Read more >Download and export monthly reports - Play Console Help
Download reports. Open Play Console. Click Download reports Reports , and select Reviews, Statistics, or Financial. Under "Select an application," type and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I know it an old issue, leaving my solution for others who ran into it. I solved the issue by using wait() instead of await:
credential.RequestAccessTokenAsync(CancellationToken.None).Wait();
Hi Jan
Yes when I import those two classes into my local code with the additions of ConfigureAwait(false), then everything works.
cheers
James
On 15 October 2015 at 23:11, Jan Tattermusch notifications@github.com wrote:
James Ellis-Jones Head of Technology
News: Great Italian Chefs - coming soon http://www.greatitalianchefs.com/
www.greatbritishchefs.com