转载请注明原文地址地址:http://blog.youkuaiyun.com/btyh17mxy/article/details/9939035
在Google Apps中域管理员可以访问域中其他用户的数据,包括Drive、Gmail什么的。当然要想访问就需要进行domain-wide(域)认证。
在Google的官方文档中只有https://developers.google.com/drive/delegation这么一篇,介绍的是Drive的domain-wide认证,我参考了这篇文档并做了些修改。
#-coding:utf-8
#!/usr/bin/python
import httplib2
import pprint
import sys
from apiclient.discovery import build
from oauth2client.client import SignedJwtAssertionCredentials
"""Email of the Service Account"""
SERVICE_ACCOUNT_EMAIL = '下图中的email地址'
"""Path to the Service Account's Private Key file"""
SERVICE_ACCOUNT_PKCS12_FILE_PATH = &#