Ophir Yoktan
Ophir Yoktan

Reputation: 8449

When accessing google driver from google colab, is it possible to eliminate, or simplify authentication?

to access google drive files, you need to call: google.colab.auth.authenticate_user(), which presents a link to an authetication screen, which gives a key you need to paste in the original notebook

  1. is it possible to skip this all together? after all the notebook is already 'linked' to a specific account

  2. is it possible to save this token hardcoded in the notebook for future runs?

  3. is it possible to create a token that can access only some files (useful when sharing the notebook with others - you want to give access only to some data files)

  4. is it possible to simplify the process (make it a single click, without needing to copy paste the token)

Upvotes: 3

Views: 1010

Answers (1)

Craig Citro
Craig Citro

Reputation: 6625

  1. Nope, there's no way to avoid this step at the moment.

  2. No, there's no safe way to save this token between runs.

  3. Sharing the notebook doesn't share the token. Another user executing your notebook will go through the auth flow as themselves, and will only be able to use the token they get for Drive files they already have access to.

  4. Sadly, not right now. :)

Upvotes: 2

Related Questions