Skip to content

Replace deprecated oauth2client with Google OAuth Library#683

Merged
dbarnett merged 5 commits into
insanum:masterfrom
dgrieser:master
Aug 22, 2024
Merged

Replace deprecated oauth2client with Google OAuth Library#683
dbarnett merged 5 commits into
insanum:masterfrom
dgrieser:master

Conversation

@dgrieser
Copy link
Copy Markdown
Contributor

This is another attempt to remove the 7 day limit.
See: #634

Thanks to hramrach and his PR #677.

Changes

  1. oauth2client was completely replaced by google_auth_oauthlib
  2. By default, no browser is opened, but a local webserver will be started and must be accessible by a browser
  3. Options removed since they were part of oauth2client:
    • --noauth_local_webserver
    • --auth_host_name AUTH_HOST_NAME
    • --auth_host_port [AUTH_HOST_PORT [AUTH_HOST_PORT ...]]
    • --logging_level

For security reasons Google removed the run_console() strategy from their Google OAuth library.
Currently there is no feasable way to not run a local web server using this library.
See: googleapis/google-auth-library-python-oauthlib@1391486

Workaround for headless systems

If you run gcalcli on a headless linux system, you can use a SSH tunnel to make the local web server, started by the OAuth flow, accessible:

ssh -L 8080:localhost:8080 <host>

@dbarnett
Copy link
Copy Markdown
Collaborator

I tried this out locally. It seemed to setup auth fine. I did notice that auth for the calm command seemed to be confusingly independent of auth for the list command, but it might've always been like that?

@dbarnett
Copy link
Copy Markdown
Collaborator

All looks good to me and seems to work well. Merging.

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

Successfully merging this pull request may close these issues.

2 participants