Gmail API突然停止工作。错误消息说未授权的_client
自过去4年以来,我们一直在使用Gmail API来阅读电子邮件,但是它突然停止工作并投掷例外:错误:“ unuthorized_client”,Description:“ client:“未经授权无法使用此方法检索访问令牌,或 范围。
客户未
授权任何要求的
We have been using Gmail API since the last 4 years without issue to read emails, but it suddenly stopped working and throwing exceptions: Error: "unauthorized_client", Description: "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.", Uri:"
Checked the service account and it's active, so no issue there as well.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
。不确定的是,
使用.NET使用的Google OUATH的三种类型的
凭据
可以 您会说,您使用的是使用它的代码,
如果您使用的是服务帐户,请确保
Google
-net/“ rel =” nofollow noreferrer”>带有Google Workspace和.net的Gmail API
Is a fairly common error, why you are first getting it now im not sure.
There are three different types of credentials for google Ouath that can be used with .net. Desktop app, installed app and service account.
The credentials are different for each one. The code that uses them is also different.
The error message you are getting says that you are using credentials with code that it is not designed for.
So if you are using a service account, make sure that
service account
Your code should look something like this.
Gmail api with google workspace and .net