question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider GoogleCredential.WithHttpClientFactory

See original GitHub issue

We’ve seen a few issues where users have wanted to set a proxy locally - and they can do so via an HttpClientFactory for the main service, but doing that for auth is harder. For GoogleCredential, adding a CreateWithHttpClientFactory method would be in line with our CreateWithUser call. That wouldn’t help for UserCredential, admittedly. Do we also want to provide an out-of-the-box proxy-supporting HttpClientFactory to avoid each user doing their own thing?

I’m not at all certain we want to do any of this, but we should at least consider it.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
amanda-tarafacommented, Apr 8, 2020

I’ll look into this.

0reactions
amanda-tarafacommented, Jun 15, 2021

FYI: This has been released on the v1.52.0 of the Google.Apis libraries.

Usage will look something like this:


IWebProxy proxy = ...;
Google.Apis.Http.IHttpClientFactory factory = HttpClientFactory.ForProxy(proxy);

GoogleCredential credential = GoogleCredential.GetApplicationDefault(); // Or any other way of getting a GoogleCredential.
credential = credential.CreateWithHttpClientFactory(factory);

// Use credential normally.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Class GoogleCredential (2.1.2) | Java client library
This is the built-in service account if running on Google Compute Engine or the credentials file from the path in the environment variable ......
Read more >
azure - class Google.Apis.Auth.OAuth2.GoogleCredential. ...
As you guessed, the Google Auth Library contains the necessary classes required to authenticate against Google services. Please, consider ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found