验证服务器端的Gmail帐户

时间:2014-10-31 07:46:48

标签: google-app-engine authentication oauth google-drive-api

我需要让客户登录系统并上传文件。我正在开发使用谷歌应用引擎。

所有文件都应上传到集中式谷歌硬盘(而非个人硬盘)。

因此,我需要单独验证客户端,我需要将服务器端验证到单独的驱动器帐户。

我已经使用此https://developers.google.com/drive/web/quickstart/quickstart-js

完成了客户端身份验证并将文件上传到我自己的驱动器

如何验证服务器端?

1 个答案:

答案 0 :(得分:0)

您需要使用Service Account

import httplib2
from google.appengine.api import memcache
from oauth2client.appengine import AppAssertionCredentials

credentials = AppAssertionCredentials(scope='https://www.googleapis.com/auth/drive')
http = credentials.authorize(httplib2.Http(memcache))
driveWorker = build('drive', 'v2',http = http)
相关问题