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

samples: remove browser option from user credentials sample #1147

Merged
merged 4 commits into from
Mar 2, 2022

Conversation

busunkim96
Copy link
Contributor

run_console uses the OAuth out-of-band flow, which will stop working for new clients on February 28, 2022 and stop working for all clients on October 3, 2022.

https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html?m=1#disallowed-oob

OAuth out-of-band (OOB) is a legacy flow developed to support native clients which do not have a redirect URI like web apps to accept the credentials after a user approves an OAuth consent request. The OOB flow poses a remote phishing risk and clients must migrate to an alternative method to protect against this vulnerability. New clients will be unable to use this flow starting on Feb 28, 2022.

@busunkim96 busunkim96 requested review from tswast, shollyman and a team February 22, 2022 22:57
@busunkim96 busunkim96 requested review from a team as code owners February 22, 2022 22:57
@product-auto-label product-auto-label bot added api: bigquery Issues related to the googleapis/python-bigquery API. samples Issues that are directly related to samples. labels Feb 22, 2022
# The `launch_browser` boolean variable indicates if a local server is used
# as the callback URL in the auth flow. A value of `True` is recommended,
# but a local server does not work if accessing the application remotely,
# such as over SSH or from a remote Jupyter notebook.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gcloud allows you to complete auth on a remote machine with no browser gcloud auth application-default login --no-browser, available in >=372.0.0.

This doc has an overview of what the flow looks like. I believe this new flag will take care of the general 'accessing the application remotely case' as long as the user can run gcloud on the target machine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tswast @shollyman Are there cases where a user might not be able to run gcloud on the machine where the notebook is hosted?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tswast @shollyman Are there cases where a user might not be able to run gcloud on the machine where the notebook is hosted?

Oh dear. 😱 I'm not sure about "can't" but this will add significant friction to folks using hosted notebooks on other clouds such as Azure Machine Learning Notebooks or Amazon SageMaker.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing this to my attention. I believe I'll need to prioritize pydata/pydata-google-auth#53 and ideally pydata/pydata-google-auth#48 as well due to this auth change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kubeflow notebooks and other self-hosted notebook systems like Jupyter Hub will also have a problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Tim, it looked like some other teams working with Notebooks are also trying to figure out how this impacts their users. dujinhui@ is on the team leading the OOB deprecation if you need a point of contact.

@tswast
Copy link
Contributor

tswast commented Mar 1, 2022

Approving, but as discussed separately, much more work needs to be done to have a clean migration path, especially for remote notebook users.

@tswast tswast merged commit eea935c into main Mar 2, 2022
@tswast tswast deleted the oob-deprecation branch March 2, 2022 17:01
abdelmegahedgoogle pushed a commit to abdelmegahedgoogle/python-bigquery that referenced this pull request Apr 17, 2023
…is#1147)

* samples: remove run_console from user credentials sample

* Update samples/snippets/user_credentials.py

Co-authored-by: Tim Swast <[email protected]>

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Tim Swast <[email protected]>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants