Token has expired or revoked - Google Ads(令牌已过期或被撤销 - Google Ads)
问题描述
您好,我一直在使用 rest 方法将 Google Ads API 集成到 C# 中.一切似乎都运行良好,但突然间我开始收到 400 响应错误消息.
Hi I have been using rest methods to integrate Google Ads API in C#. Everything seemed to be working fine but all of sudden I started getting 400 response with the error message.
{
"error": "invalid_grant",
"error_description": "Token has been expired or revoked."
}
如上所述,我没有使用客户端库,而是使用 restsharp 并使用邮递员测试我的所有端点.
As mentioned above that I am not using client library but instead using restsharp and testing all my end points using postman also.
发生这种情况的任何原因?我的刷新令牌也是有效的.我已经使用了一个星期.我也没有达到刷新令牌的限制,因为我在尝试设置帐户时只生成了 3 到 4 次刷新令牌.
Any reason why it is happening? My refresh token is also valid. I have been using this for one week. I have also not reached to the limit of refresh token as I have only generated refresh token 3 to 4 times when I was trying to set up the accounts.
我相信刷新令牌的有效期是终身的,那为什么会发生呢?
I believe the validity of refresh token is life long then why it is happening?
推荐答案
我通过使用 Playground 生成新的刷新令牌解决了这个问题.过期的原因是我项目的 OAuth 同意屏幕的发布状态是测试模式.
I solved the problem by generating new refresh token using playground. The reason it expired because the publishing status of OAuth consent screen of my project was on testing mode.
如果您正在集成 API,则需要为 生产 应用发布状态,以避免在过期时手动生成刷新令牌.
If you are integrating an API, you need to apply publishing status for production to avoid manual generation of refresh tokens when it expires.
这篇关于令牌已过期或被撤销 - Google Ads的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:令牌已过期或被撤销 - Google Ads
基础教程推荐
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- WPF 模态进度窗口 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
