简体   繁体   中英

How to upload and retrieve the files from Google drive with static credentials android

I have the requirement of saving files to google drive of Admin account and then retrieving. Now i am able to upload the files to Users google drive account which is in his phone, i am not able to give static credentials of my drive. Is there any Possibility?Please give the reference of giving static credentials to the google drive to save and retrieve the files.

First, be aware of the security implications of embedding static credentials. As a minimum, use only drive.file scope, so the credentials only allow access to files created by the app.

The "static credential" you are referring to is a Refresh Token. You will use this to fetch an Access Token whenever your app needs to access GDrive. This answer How do I authorise an app (web or installed) without user intervention? (canonical ?) describes the detailed steps to follow.

You should also consider using a Service Account instead of a regular account for the app's storage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM