0

I have a web app and I want to serve documents from inside my app to users logging into the it. I can upload the documents to the webserver that runs my own app but I wanted to see if there is a way to access the documents from google drive where I saved them.

I was able to get the link below to work but it seems like I would have to login every time I need to download the file.

https://developers.google.com/drive/web/quickstart/quickstart-python#step_1_enable_the_drive_api

Is there something I can do to avoid having to login into my own drive every time, like saving the access token in a file for later use?

Thanks, Akhil

akhil
  • 839
  • 3
  • 8
  • 15

1 Answers1

0

Is there something I can do to avoid having to login into my own drive every time, like saving the access token in a file for later use?

Request offline access which will give you a refresh token which you will save. Use the refresh token to fetch an access token whenever you need to access your Drive. See How do I authorise an app (web or installed) without user intervention? (canonical ?) for more info on getting the refresh token.

Community
  • 1
  • 1
pinoyyid
  • 21,499
  • 14
  • 64
  • 115