令牌已过期或被撤销 - Google Ads

Token has expired or revoked - Google Ads(令牌已过期或被撤销 - 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)