简体   繁体   English

如何使用静态凭据从Google驱动器上载和检索文件

[英]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. 我需要将文件保存到Admin帐户的Google驱动器中,然后进行检索。 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. 现在,我可以将文件上传到他手机中的用户Google驱动器帐户,我无法提供驱动器的静态凭据。 Is there any Possibility?Please give the reference of giving static credentials to the google drive to save and retrieve the files. 有任何可能吗?请提供给Google驱动器静态凭证的参考,以保存和检索文件。

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. 至少,仅使用drive.file范围,因此凭据仅允许访问由应用程序创建的文件。

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. 每当您的应用需要访问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. 您还应该考虑使用服务帐户而不是常规帐户来存储应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我想将图像上传到Google驱动器并在android-eclipse中从Google驱动器检索图像URL吗? - i want to upload image into Google drive and retrieve the image URL from Google drive in android- eclipse ? Google Drive Android API如何将音频文件上传到我的驱动器? 如何同步驱动器文件? - Google Drive Android API how to upload a audio file to my drive ? How to sync drive files? 如何从Android中的谷歌驱动器中选择文件? - How to select files from google drive in android? 如何将文件上传到Google云端硬盘Android中的特定文件夹 - How to upload files to particular folder in Google Drive Android 如何使用Google Drive上的android上传/下载文件? - How to upload/download files using android on google drive? 如何在Android中使用进度条在Google驱动器上上传文件 - How to upload files on Google drive with progress bar in Android Android Google Drive SDK上传文件? - Android Google Drive SDK upload files? 如何将文件从Google云端硬盘上传到我的应用? - How to upload files from Google Drive to my app? 如何将文件从 android 上传到谷歌驱动器 - How do I upload file to google drive from android 如何从Android应用程序上传db文件到谷歌驱动器? - How to upload a db file to google drive from android application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM