【问题标题】:Authenticate gmail account for server side验证服务器端的 gmail 帐户
【发布时间】:2014-10-31 07:46:48
【问题描述】:

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

所有文件都应该上传到一个集中的谷歌驱动器(而不是个人驱动器)。

因此我需要单独对客户端进行身份验证,并且需要将服务器端身份验证为单独的驱动器帐户。

我已经使用https://developers.google.com/drive/web/quickstart/quickstart-js完成了客户端身份验证并将文件上传到我自己的驱动器

如何验证服务器端?

【问题讨论】:

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


    【解决方案1】:

    您需要使用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)
    

    【讨论】:

    • 谢谢。我会试试的:)
    猜你喜欢
    • 2019-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-05
    • 2010-11-20
    • 2020-06-24
    • 2016-01-21
    • 2014-09-13
    相关资源
    最近更新 更多