Google Drive API:以编程方式登录 [英] Google Drive API : login programmatically

查看:149
本文介绍了Google Drive API:以编程方式登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发将文件上传到Google云端硬盘所需的应用程序。
我开始从以下链接学习API。
https://developers.google.com/drive/ios/quickstart

目前,我必须首次登录上传文件。但在我的应用程序中,每次有相同的帐户将用于上传文件。
那么,有什么方法可以绕过GTMOAuth2ViewControllerTouch(登录屏幕)。



请帮助我。
我会非常感谢您的重播。

解决方案

大多数Google API目前都需要OAuth 2令牌,所以只有通过用户控制的登录流程才可用,这是gtm-oauth2提供的功能。一些较早的Google API支持ClientLogin协议,其中用户名和密码由应用程序直接提供,但较新的API请记住,将任何帐户授权(特别是帐户密码)硬编码到应用程序的二进制文件中存在安全风险,并且
是不好的习惯。



I am developing application which is required to upload file into Google Drive. I started learning API from following link. https://developers.google.com/drive/ios/quickstart

Currently,I have to login first time for upload file. But in my application, every time there is same account will be used for uploading file. So, is there any way by which I can bypass GTMOAuth2ViewControllerTouch (login screen).

Please help me. I will be very thankful for your replay.

解决方案

Most Google APIs currently require an OAuth 2 token, and so far that is available only via the user-directed sign-in flow, which is what gtm-oauth2 provides.Some older Google APIs do support the ClientLogin protocol, in which the username and password are supplied directly by the application, but the newer APIs do not.

Remember that hardcoding any account authorization(especially an account password) into an application's binary is a security risk and is poor practice.

这篇关于Google Drive API:以编程方式登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆