-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BigQuery authentication on remote servers #8489
Comments
cc @jacobschaer |
What I wound up doing to get around this was to run a basic query using an iPython notebook, authenticating with Google BigQuery, and then copying the resulting bigquery_credentials.dat file to the remote servers. Initially I had to just rename the .bigquery.v2.token that the old client used. Annoying, but it at least works since it has a refresh token so I don't need to touch it. Would be nice to get a better flow going. |
@andrewryno Just curious, what would a good flow be for you? I haven't had this use case in a while... When we originally wrote the module it would yield a token string to enter into your browser. What version of the bigquery libraries are you using? |
@jacobschaer I've thought about it a bit but haven't come up with a great solution. As long as I can do it in a REPL on a remote server without a browser, that's fine. I can't remember which tool it was (old bq version possibly), but they output the URL for you to go to manually, set the redirect_uri to urn:ietf:wg:oauth:2.0:oob which gives you a code to enter into the CLI. Won't try to open a browser automatically but you do it manually to finish the flow. It's the installed application flow instead of a user flow. |
This exists in the latest code (0.17.0). When I run I would like to try and develop a feature to improve the authentication flow on remote servers if no one else is working on it. |
@parthea you could certainly pull that out and re-purpose it (e.g. you can incorporate parts of that and/or copy) and then just open a new PR |
I have a new proposal in #11141. Let me know if it is ok and I will implement. |
Well, my suggestion will be don't use Google Account credentials, which is very personal and should not be presented in any public servers. Please consider using Service Account instead.
So to sum up, reasons to use Service Account are:
Also please note that, Service Account is designed for your app to access Google API without requiring user to sign in. If, you want users to access their personal data (with their own permission), then use browser flow instead. |
It is recommended by Google that we use Service Account credentials make API calls from server. See [this issue comment](pandas-dev#8489 (comment)) for details. Signed-off-by: John Wu <[email protected]>
To further illustrate my solution, refer to my rough implementation #11335 |
Using JupyterHub may reduce the concern . See JupyterHub From JupyterHub GettingStarted: I'm not too familiar with JupyterHub. I'm going to start playing around with it to see if there is a better (secure) solution for authenticating users using the browser flow. JupyterHub looks very promising. |
@parthea I am not familiar with JupiterHub either. But I don't think it will be a good idea to rely on other tools. I mean, scenarios are different, and we cannot make any assumptions about what kind of environment panda will be run against. |
IPython (Jupyter) is listed in the pandas ecosystem under IDE. |
@parthea It's still just one of them, right? So it's an assumption, which I personally don't agree with it. Like in our use case we don't use that at all. Sure problem can be solve if you use both Jupiter with JupiterHub, specifically, which is not a common solution, in terms of using pandas. :) |
It sounds like supporting both service account and user account is the best option. In that case, it is up to the user to select which configuration is the most appropriate for their specific setup. |
+1 for supporting both of them. My reason will be backward compatibility, though. |
@ RTBHouse we are using service account auth since may. Yesterday I eventually decided to create pull request. See #11881 . I think it will fulfill requirements mentioned here. |
Hello, I can't get the BigQuery auth to work on remote servers:
Even if I try to open that URL on my workstation, it tries to redirect me to a local server. The documentation says that:
however, I've yet to see this alternative.
Any help?
The text was updated successfully, but these errors were encountered: