Skip to content
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

use colab-specific auth if detected on colab #64

Closed
tswast opened this issue Jan 24, 2023 · 5 comments
Closed

use colab-specific auth if detected on colab #64

tswast opened this issue Jan 24, 2023 · 5 comments
Assignees

Comments

@tswast
Copy link
Collaborator

tswast commented Jan 24, 2023

Similar to #63, if we detect that we are on a colab environment, we can use the colab auth by default. Note: I think this should ignore the "local webserver" parameter, as colab uses a slightly different kind of flow.

@tswast
Copy link
Collaborator Author

tswast commented Mar 10, 2023

See: https://colab.research.google.com/notebooks/bigquery.ipynb

from google.colab import auth
auth.authenticate_user()
print('Authenticated')

@tswast
Copy link
Collaborator Author

tswast commented Mar 10, 2023

Edit: This is only an FYI for internal Googlers, so that they are aware that this feature needs to be tested on colab.research.google.com, not the internal hosted version.

I think internal colab is slightly different?

from colabtools import bigquery
from colabtools import auth

bigquery.magics.context.credentials = auth.get_user_oauth2_credentials(bigquery.SCOPES)
bigquery.magics.context.project = 'projectid'  # Replace with your project ID, eg "stunning-gauss-827"

@shobsi
Copy link
Collaborator

shobsi commented Mar 22, 2023

@tswast I tested the above steps (#64 (comment)) on colab.corp.google.com. The authentication is successful but the client creation fails. Am I missing something?

image

@tswast
Copy link
Collaborator Author

tswast commented Apr 5, 2023

@tswast I tested the above steps (#64 (comment)) on colab.corp.google.com. The authentication is successful but the client creation fails. Am I missing something?

Internal colab is not a priority. Please ignore.

@shobsi
Copy link
Collaborator

shobsi commented May 8, 2023

This issue can be closed after #68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants