cd /news/cloud-computing/fixing-google-bigquery-auth-proxying · home topics cloud-computing article
[ARTICLE · art-9914] src=dev.to ↗ pub= topic=cloud-computing verified=true sentiment=· neutral

Fixing Google BigQuery Auth Proxying

The article explains that when using Google BigQuery client libraries in C# applications behind a proxy, authentication and token refresh requests fail because they ignore proxy settings, even when data queries are correctly proxied. The solution is to set a proxied `GoogleCredential` (created using `CreateWithHttpClientFactory`) on the `GoogleCredential` property of `BigQueryClientBuilder`, rather than the `Credential` property, to ensure OAuth token requests also route through the proxy.

read1 min views23 publishedMay 22, 2026

builder.Credential = credential;

  • Fails to route authentication traffic through the proxy.builder.GoogleCredential = credential;
  • Successfully routes OAuth token requests through the proxy.If your C# application runs behind a proxy, you have probably run into an annoying issue with the Google BigQuery client libraries: your BigQuery query calls route through the proxy perfectly by setting the HttpClientFactory property on the BigQueryClientBuilder , but the authentication and token refresh requests ignore the proxy entirely and attempt to hit the standard network, causing timeouts. To resolve this, set a proxied GoogleCredential to the GoogleCredential property instead of the Credential property on the client builder. Example code:
using System.Net;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Http;
using Google.Cloud.BigQuery.V2;
// 1. Configure your proxy
IWebProxy proxySettings = new WebProxy("http://your-proxy-host:8080", bypassOnLocal: true)
{
Credentials = new NetworkCredential("username", "password")
};
// 2. Wrap it inside Google's API HttpClientFactory

HttpClientFactory proxyClientFactory = HttpClientFactory.ForProxy(proxySettings);

// 3. Load credentials and create a new credential using the proxied http client factory
GoogleCredential credential = await GoogleCredential.FromFileAsync("path/to/service-account.json");
credential = credential.CreateWithHttpClientFactory(proxyClientFactory);
// 4. Construct the client

BigQueryClient bigQueryClient = new BigQueryClientBuilder

{
ProjectId = "your-google-cloud-project-id",

HttpClientFactory = proxyClientFactory, // Proxies BigQuery data calls GoogleCredential = credential // CRITICAL: Proxies Auth/token calls }.Build();

── more in #cloud-computing 4 stories · sorted by recency
── more on @google bigquery 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/fixing-google-bigque…] indexed:0 read:1min 2026-05-22 ·