diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 8cb868c..86567d6 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -1,6 +1,15 @@ Changelog ========= +.. _changelog-1.8.0: + +1.8.0 / (2023-05-09) +-------------------- + +- When running on Google Colab, try Colab-based authentication + (``google.colab.auth.authenticate_user()``) before attempting the Google + Application Default Credentials flow. (:issue:`68`) + .. _changelog-1.7.0: 1.7.0 / (2023-02-07) diff --git a/docs/source/intro.rst b/docs/source/intro.rst index 03c0a83..038b005 100644 --- a/docs/source/intro.rst +++ b/docs/source/intro.rst @@ -24,6 +24,16 @@ User credentials Use the :func:`pydata_google_auth.get_user_credentials` to get user credentials, authenticated to Google APIs. +By default, pydata-google-auth will listen for the credentials on a local +webserver, which is used as the redirect page from Google's OAuth 2.0 flow. +When you set ``use_local_webserver=False``, pydata-google-auth will request +that you copy a token from the :ref:`oauth-sign-in` page. + +.. toctree:: + :maxdepth: 2 + + oauth.rst + Default credentials ------------------- diff --git a/docs/source/oauth.rst b/docs/source/oauth.rst index 4cdbc6b..ab55c89 100644 --- a/docs/source/oauth.rst +++ b/docs/source/oauth.rst @@ -2,6 +2,9 @@ :alt: pydata logo :class: logo + +.. _oauth-sign-in: + Sign in to BigQuery =================== diff --git a/pydata_google_auth/auth.py b/pydata_google_auth/auth.py index 729d0ee..c97c9b6 100644 --- a/pydata_google_auth/auth.py +++ b/pydata_google_auth/auth.py @@ -165,7 +165,7 @@ def _ensure_application_default_credentials_in_colab_environment(): from google.colab import auth auth.authenticate_user() - except (ModuleNotFoundError, ImportError): + except ImportError: pass