google-api-dotnet-client: Vague Authentication failure

I’m getting a vague authentication failure from GetApplicationDefaultAsync().

{“Error reading credential file from location C:\ArtofShell\Google\Vision\GoogleCred.json: Bad Data.\r\n\nPlease check the value of the Environment Variable GOOGLE_APPLICATION_CREDENTIALS”}

image

Here’s my code:

Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", @"C:\ArtofShell\Google\Vision\GoogleCred.json");
var credential = await GoogleCredential.GetApplicationDefaultAsync();

Repro steps:

  1. I created a Service Account
  2. I downloaded the credential file
  3. I set the environment variable to the path of the credential file
  4. Attempted to call GetApplicationDefaultAsync()

Cheers, Trevor Sullivan Microsoft MVP: Cloud & Data Center Management https://trevorsullivan.net https://twitter.com/pcgeek86

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 23 (2 by maintainers)

Most upvoted comments

Our mistake – we thought we saw a pattern of failures after the latest release, but it turned out to be a problem in our own code. Please excuse the false alarm.