Direct Colab OAuth to Anvil frontend

What I’m trying to do:

I’ve been able to successfully connect an Anvil frontend to a colab python notebook which accesses the user’s Google Drive (based on their OAuth authentication dialog).

Because the OAuth dialog is inline within the colab notebook, the end user has to keep both the Anvil frontend and the Colab backend screens open (Anvil to make the request, Colab to authenticate Google Drive access). Is there a way to direct the Oauth dialog that is triggered by invoking the GDrive API to the Anvil frontend?. TIA

Have you seen the docs below? I’m not sure whether this does what you’re looking for or not:
anvil.google.drive.login()
https://anvil.works/docs/integrations/google/google-drive#user-files

Thanks Tim, I hadn’t seen this. However after trying this out, it seems to be front-end code API that would enable access/authentication for Google Drive only in the Anvil front-end code for front-end based Drive file access (not model server backend on Colab). Colab error included below.

code:
anvil.server.connect()
anvil.google.drive.login()
error:
Exception: anvil.google.auth.login cannot be called from a server module - call it from your Form code instead

1 Like