简体   繁体   English

Google API-如何使用硬编码的用户名和密码登录?

[英]Google API - how to login with username and password hardcoded?

I have a mobile app where people uploads image. 我有一个移动应用程序,人们可以在其中上传图片。 I don't have enough space on my server to store all the images.. I was thinking to store all the images on google drive. 我的服务器上没有足够的空间来存储所有图像。.我正在考虑将所有图像存储在Google驱动器上。 Wanted to check.. how can I login to google api with hardcoded username and password ? 想要检查..如何使用硬编码的用户名和密码登录google api? I cannot use oAuth as user's will not input the username and passwords. 我无法使用oAuth,因为用户不会输入用户名和密码。 My backend is in PHP. 我的后端在PHP中。

Please help. 请帮忙。

Thanks. 谢谢。

Logging in with a login and password is called client login. 使用登录名和密码登录称为客户端登录。 April 2015 Google shut down client login servers. 2015年4月,Google关闭了客户端登录服务器。 You cant access any of the Google APIs with a login and password you must use Open authentication. 您无法使用必须使用Open身份验证的登录名和密码访问任何Google API。

I suggest you consider using a service account . 我建议您考虑使用服务帐户 A service account is a dummy sudo user it has its own drive account and you can login and upload files to it directly though the API. 服务帐户是虚拟的sudo用户,它具有自己的驱动器帐户,您可以通过API直接登录并将文件上传到该帐户。

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

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