Search code examples
google-apigoogle-bigquerygoogle-oauthgoogle-cloud-shell

How to use anything but Google Shell or Web browser when oauth2.googleapis.com is blacklisted (not sure about this)?


I can not connect to Google Services from client application if it is trying to communicate with oauth2.googleapis.com (which is probably blocked in my corporate network - I dont know how to test it for sure).


I tried BigQuery with JDBC driver in Dbeaver. With basic settings. JDBC Dbeaver issue

User-based login does this: It generates link for OAUTH. I open the browser and login with the right google account. Then I insert generated code into the Dbeaver and I recieve that AUTH has failed.

Service-based login does this: It does not want me to visit any webpage. It just tells me:

[Simba][BigQueryJDBCDriver](100004) HttpTransport IO error : oauth2.googleapis.com.

I also tried to use ODBC, where PROXY can be filled in. But no luck. When I take a look into 'Proxy Options' the proxy port is always rewritten by proxy host. Weird.

This is what happens when i click on 'catalog' or 'dataset' drop-down field. I cant do any further steps. ODBC BQ issue


BUT! When I set my HTTP PROXY in GCLOUD CLI APP then communication works. And I can call BQ from it.

Does it mean that GCLOUD communicates through HTTP Proxy and DBeaver or ODBC does not? Or does it mean that GCLOUD does not need oauth2.googleapis.com but ODBC and JDBC do and it is blacklisted? I am confused.

We need to migrate from our internal environment to GCP. We would love to use various applications. I would ask for whitelisting oauth2.googleapis.com but i am not sure this is the only problem as GCLOUD app works without any flaws.

I am not-experienced with networking so i am more than happy to update / correct this question or add any info (if you need) to help me understand this issue. Thank you


Solution

  • According to your description, your corporate network is using a Proxy to reach out Internet, this is the reason why gcloud is capable to reach out BigQuery service when Proxy settings are configured in your system; through Cloud SDK Proxy settings or HTTP PROXY environment variable.

    You require to setup the proxy settings within the JDBC connection string as described in Simba JDBC driver documentation, e.g.:

    jdbc:bigquery:DataSetId=MyDataSetId;ProjectId=MyProjectId;OAuthType=1;ProxyHost=MyProxyHost;ProxyPort=MyProxyPort;ProxyUID=MyProxyUsername;ProxyPWD=MyProxyPassword
    

    This connection string will indicate the Proxy settings to Simba JDBC driver.