本文介绍了Java示例。验证方法。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我选择了最简单的示例https://msdn.microsoft.com/en-US/library/bing-ads-search-accounts-java-code-example.aspx。在该示例中具有以下访问属性:

用户名

密码

DeveloperToken

我有它们。开发人员令牌已升级为多用户。

但该示例不适用于这些属性。我收到消息:
$
AdApiError

代码:105

错误代码:InvalidCredentials

消息:身份验证失败。提供的凭据无效或帐户处于非活动状态。



然后我尝试了另一种方法。我在这个链接上运行代码https://msdn.microsoft.com/en-us/library/bing-ads-java-walkthrough-desktop-application.aspx,我获得了访问刷新令牌。然后我用这里描述的方法https://social.msdn.microsoft.com/Forums/en-US/375fbdce-2d69-4a21-bbcf-42a2f1663181/oath-authentication-to-bing-ads-api-using-the -java-API的作业没有的UI?论坛= BingAds。
我更改了原始代码示例并且它有效。我使用ClientId和RefreshToken而不是UserName和Password。

但是我仍然对使用UserName和Password运行该示例的可能性感兴趣。有人可以帮忙解决这个问题吗?

I chose the most simple example https://msdn.microsoft.com/en-US/library/bing-ads-search-accounts-java-code-example.aspx. In that example has the following access attributes:
UserName
Password
DeveloperToken
I'm have them. Developer token was upgraded to multi-user.
But that example does not working with these attributes. I get the message:
AdApiError
Code: 105
Error Code: InvalidCredentials
Message: Authentication failed. Either supplied credentials are invalid or the account is inactive.

Then I tried another method. I run the code at this link https://msdn.microsoft.com/en-us/library/bing-ads-java-walkthrough-desktop-application.aspx and I got access refresh token. Then I used the method described here https://social.msdn.microsoft.com/Forums/en-US/375fbdce-2d69-4a21-bbcf-42a2f1663181/oath-authentication-to-bing-ads-api-using-the-java-api-job-without-ui?forum=BingAds. I changed the original code example and it worked. I used ClientId and RefreshToken instead UserName and Password.
But I'm still interested in the possibility of to run that example using UserName and Password. Can anybody help with this?

推荐答案

对于
搜索帐户
您尝试过的示例 首先,您可以使用AuthenticationToken请求标头替换UserName和Password。浏览已经工作的OAuth流,并将AuthenticationToken设置为访问令牌的值。
欲了解更多信息,请参阅。

For the Search Accounts example that you tried first, you can replace UserName and Password with the AuthenticationToken request header. Go through the OAuth flow that you already got working, and set AuthenticationToken to the value of your access token. For more information, please see Managing User Authentication with OAuth.

致以最好的问候,

Eric


这篇关于Java示例。验证方法。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 20:37