Gmail API-将域范围的权限委派给服务帐户给单个用户 [英] Gmail API - Delegating domain-wide authority to the service account to single user

查看:56
本文介绍了Gmail API-将域范围的权限委派给服务帐户给单个用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Google应用程序中访问自定义域(my.name@example.com)中的电子邮件地址的电子邮件.我创建了服务帐户,但是在尝试阅读电子邮件时收到以下错误消息:

I am trying to access emails of an email address in custom domain(my.name@example.com) in google apps. I created service account but I get following error message when trying to read e-mails:

错误:"unauthorized_client",说明:未授权的客户端或作用域在请求中.,Uri:""

Error:"unauthorized_client", Description:"Unauthorized client or scope in request.", Uri:""

我发现我必须域范围的权限授予服务帐户.据我了解,委派后,该服务帐户将可以访问域中的所有电子邮件地址(例如john @ example.com,sam @ example.com ...).我的理解正确吗?如果是,是否有一种方法可以使服务帐户只能访问(可以被模拟)域中的一个电子邮件地址?

I found that I have to delegate domain-wide authority to the service account. According to my understanding, after delegating, the service account will have access to all e-mail addresses in the domain(eg; john@example.com, sam@example.com ...). Is my understanding correct. If yes, is there a way that service account has access (can be impersonated) to only one e-mail address in the domain?

推荐答案

您是否已在GSuite管理控制台中授权了客户端名称和API作用域?服务帐户必须正常工作,并且收到的错误似乎与API访问权限有关.

Have you authorized the Client Name and the API scopes in the GSuite admin console? It is required for the service account to work and the error you received seems to be related to the API access permissions.

更多信息,位于:

https://support.google.com/a/answer/162106?hl = zh_CN

这篇关于Gmail API-将域范围的权限委派给服务帐户给单个用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆