AdWords API 身份验证错误

发布于 2024-12-19 06:58:40 字数 298 浏览 1 评论 0原文

我过去 3 个月一直在使用 Adwords API,今天突然出现如下错误消息: 未捕获的异常“AuthTokenException”,消息为“无法获取 authToken”。原因:身份验证错误' 我正在使用 google adwords V201101 php 库,auth.ini 包含所有用户详细信息和 settings.ini 以及 https://adwords.google。 com不是沙箱环境。谁能帮我解决这个问题吗???

谢谢, 穆拉利。

I am using Adwords API from last 3 months and all of a sudden today it is coming up with error message as follows:
Uncaught exception 'AuthTokenException' with message 'Failed to get authToken. Reason: BadAuthentication'
I am using google adwords V201101 php library with auth.ini containing all user details and settings.ini with https://adwords.google.com not sandbox environment. Can anyone help me with this please???

Thanks,
Murali.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

度的依靠╰つ 2024-12-26 06:58:40

您可能会多次向 ClientLogin 服务请求 authToken,这就是您获得“CaptchaRequired”的方式。

仅在第一次请求authToken,然后将其缓存以供后续请求。

看看http://goo.gl/TOX6N

you may requesting authToken from ClientLogin service too many times, that is way you get 'CaptchaRequired'.

Request authToken just for the first time, and then cache it for subsequent requests.

Check this out http://goo.gl/TOX6N

子栖 2024-12-26 06:58:40

我最近在尝试连接到 Google DFP 广告管理系统时遇到了这个问题。开发后,我从本地主机复制了完美工作的代码,并将其运行在我的远程云服务器上。然后我收到了

获取authToken失败

消息。原因是谷歌作为安全措施阻止了尝试登录,因为这是一个新位置。我必须使用这些凭据登录谷歌帐户(从网络)才能查看消息并确认添加的登录位置。授权后一切正常。
我偶然发现了这个问题,并认为这些信息可能对其他人有帮助。

I recently had this problem trying to connect to Google DFP. I copied perfectly working code from my localhost after development and ran it on my remote cloud server. I then received the

Failed to get authToken

message. The reason was that google was blocking the attempted login as a security measure because it was a new location. I had to log into the google account (from the web) with those credentials in order to see the message and confirm the added login location. Everything worked fine after that authorization.
I've stumbled across this question and thought that this info may help someone else.

弱骨蛰伏 2024-12-26 06:58:40

BadAuthentication 意味着您的用户名/密码不正确。可能是有人更改了帐户密码,也可能是auth.ini被错误修改。

请在此处查看详细的错误代码:http://code.google.com/apis /accounts/docs/AuthForInstalledApps.html#Errors

干杯,
阿纳什

BadAuthentication means your username/password is incorrect. May be someone changed the account password, may be auth.ini got modified by mistake.

See detailed error codes here: http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Errors

Cheers,
Anash

裸钻 2024-12-26 06:58:40

在我的组织中有人更新了我的应用用于登录的帐户的密码后,我开始收到此错误。避免再次发生这种情况的最佳方法是使用 OAuth2

只需转到 Google API 控制台 并为已安装的应用程序创建客户端 ID(在 < code>API 访问)为您的项目。然后,您可以在 Adwords API auth.ini 文件中使用客户端 ID 和客户端密钥。

接下来,运行 examples/AdWords/Auth/GetRefreshToken.php 脚本,该脚本将授予您的应用访问 AdWords 帐户的权限。您最终会得到一个刷新令牌,您需要将其添加到 auth.ini 中。

ClientLogin(用户名和密码)身份验证方法已被弃用,取而代之的是上述方法,因此最好尽快迁移。

I started getting this error after somebody in my organization updated the password for the account my app was using to log in. The best way to avoid this happening again is to use OAuth2.

It's as easy as going to the Google API console and creating a Client ID for Installed Applications (under API access) for your project. You then use the Client ID and Client Secret in your Adwords API auth.ini file.

Next you run the examples/AdWords/Auth/GetRefreshToken.php script which will have you grant your app access to your Adwords account. You'll end up with a Refresh Token which you need to add to your auth.ini.

The ClientLogin (username and password) method of authentication is being deprecated in favour of the above so best to migrate ASAP.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文