1
我產生了這樣的服務帳戶憑據:如何獲得服務的承載訪問令牌帳號
f = file(settings.SERVICE_ACCOUNT_PKCS12_FILE_PATH, 'rb')
key = f.read()
f.close()
credentials = client.SignedJwtAssertionCredentials(settings.SERVICE_ACCOUNT_EMAIL, key, scope=settings.GROUPS_SCOPE, sub=settings.ADMIN_DOMAIN_EMAIL)
print 'credentials : '+str(credentials.to_json())
打印顯示JSON格式的憑據:
{"private_key": "MIIGwAIBAzCCBnoGLUn09Ywa1l7G8XC2SgA9eDhXAdKw4DAh...83J+6iAgIEAA==", "id_token": null, "token_uri": "https://accounts.google.com/o/oauth2/token", "token_response": null, "client_id": null, "scope": "https://www.googleapis.com/auth/admin.directory.group", "token_expiry": null, "_class": "SignedJwtAssertionCredentials", "refresh_token": null, "_module": "oauth2client.client", "private_key_password": "notasecret", "access_token": null, "service_account_name": "[email protected]", "invalid": false, "assertion_type": null, "kwargs": {"sub": "[email protected]"}, "client_secret": null, "revoke_uri": "https://accounts.google.com/o/oauth2/revoke", "user_agent": null}
這產生私人密鑰ans訪問令牌爲空。
是否有一個類指定了here指定的REST請求來獲取訪問令牌?