nithinmurali / pygsheets

Google Sheets Python API v4
https://pygsheets.readthedocs.io/en/latest
Other
1.51k stars 220 forks source link

Google is deprecating the OOB Oauth2 workflow #535

Open jtroo opened 2 years ago

jtroo commented 2 years ago

See: https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html#disallowed-oob

I believe this is the auth method used by pygsheets, so this will need to be changed to continue working into the future.

danpf commented 2 years ago

If you are just working locally then you should set local=True in authorize, the run_local_server method is the replacement method. Now you will need to use the browser pop up to authorize pygsheets.

see https://github.com/nithinmurali/pygsheets/blob/staging/pygsheets/authorization.py#L45 for the internal code flow This else is deprecated

If you are working on a remote machine without browser access... I'm not sure what you should do but this thread seems to have some clues: https://github.com/r-lib/gargle/issues/202

jon-trust commented 2 years ago

Note for anyone having trouble with their migration from oob.

Once you changed your local credential, if you have the error deleted_client: The OAuth client was deleted. Delete the local file named sheets.googleapis.com-python.json

cdibble commented 2 years ago

Thanks for the pointers. After running an interactive auth flow using pygsheets.authorize(local=True) the sheets.googleapis.com-python.json was generated in the current working directory. That file can be used in subsequent (including headless) auth flows.

RinUnderscore commented 1 year ago

I believe Google has now deprecated the auth method that Pygsheet uses and now I believe that Pygsheets doesn't work.