使用全新令牌无效凭据错误 [英] Invalid credentials error with brand new token

查看:74
本文介绍了使用全新令牌无效凭据错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在为特定登录信息获取Bing Ads数据时遇到身份验证错误。在我们完成服务器端OAuth流后,我们立即使用提供的access_token在Customer Management
服务上向GetAccountsInfo请求发出请求,并立即收到错误105.


以下是剥离令牌的示例请求:


SOAP请求:https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v11/CustomerManagementService。 svc

SOAPAction:" GetAccountsInfo",Content-Type:text / xml; charset = UTF-8,Content-Length:1976

<?xml version =" ; 1.0" encoding =" UTF-8"?>< env:Envelope xmlns:xsd =" http://www.w3.org/2001/XMLSchema"的xmlns:的xsi = QUOT; HTTP://www.w3.org/2001/XMLSchema-instance"的xmlns:TNS = QUOT; HTTPS://bingads.microsoft.com/Customer/v11"
xmlns:env =" http://schemas.xmlsoap.org/soap/envelope/"的xmlns:ins0 = QUOT; HTTPS://adapi.microsoft.com"的xmlns:INS1 = QUOT; HTTPS://bingads.microsoft.com/Customer/v11/Entities"的xmlns:INS2 = QUOT; HTTPS://bingads.microsoft.com/Customer/v11/Exception"
xmlns:ins3 =" http://schemas.datacontract.org/2004/07/System.Collections.Generic"的xmlns:INS4 = QUOT; HTTP://schemas.microsoft.com/2003/10/Serialization/Arrays">< ENV:页眉和GT;< TNS:ApplicationToken>< / TNS:ApplicationToken>< TNS:AuthenticationToken> ;节录< / TNS:AuthenticationToken>< TNS:DeveloperToken>删节< / TNS:DeveloperToken>< TNS:密码>< / TNS:密码>< TNS:用户名>< / TNS:用户名>< / env:标题>< env:Body>< tns:GetAccountsInfoRequest
xmlns =" https://guideads.microsoft.com/Customer/v11">< / tns:GetAccountsInfoRequest>< / env :Body>< / env:Envelope>

对clientcenter.api.bingads.microsoft.com(httpclient)的HTTPI POST请求

SOAP响应(状态500)

< s:Envelope xmlns:s =" http://schemas.xmlsoap.org/soap/envelope/">< s:Body>< s:Fault>< faultcode> ; s:服务器< / faultcode>< faultstring xml:lang =" en-US">无效的客户端数据。检查SOAP故障详细信息以获取更多
信息< / faultstring>< detail>< AdApiFaultDetail xmlns =" https://adapi.microsoft.com"的xmlns:I =" HTTP://www.w3.org/2001/XMLSchema-instance">< TrackingId> fe480158-35a6-4aff-8d4f-cb79fbfe9c64< / TrackingId><错误>< AdApiError>< ;代码> 105< /代码><详细信息
i:nil =" true" />< ErrorCode> InvalidCredentials< / ErrorCode><消息>身份验证失败。提供的凭据无效或帐户处于非活动状态< / Message>< / AdApiError>< /错误>< / AdApiFaultDetail>< / detail>< / s:错误>< / s:Body>< / s:信封>



在调试时,我们尝试使用GetUser请求并获得相同的结果:


SOAP请求:https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v11/CustomerManagementService.svc

SOAPAction:" GetUser",Content-Type:text / xml; charset = UTF-8,Content-Length:1960

<?xml version =" 1.0" encoding =" UTF-8"?>< env:Envelope xmlns:xsd =" http://www.w3.org/2001/XMLSchema"的xmlns:的xsi = QUOT; HTTP://www.w3.org/2001/XMLSchema-instance"的xmlns:TNS = QUOT; HTTPS://bingads.microsoft.com/Customer/v11"
xmlns:env =" http://schemas.xmlsoap.org/soap/envelope/"的xmlns:ins0 = QUOT; HTTPS://adapi.microsoft.com"的xmlns:INS1 = QUOT; HTTPS://bingads.microsoft.com/Customer/v11/Entities"的xmlns:INS2 = QUOT; HTTPS://bingads.microsoft.com/Customer/v11/Exception"
xmlns:ins3 =" http://schemas.datacontract.org/2004/07/System.Collections.Generic"的xmlns:INS4 = QUOT; HTTP://schemas.microsoft.com/2003/10/Serialization/Arrays">< ENV:页眉和GT;< TNS:ApplicationToken>< / TNS:ApplicationToken>< TNS:AuthenticationToken> ;节录< / TNS:AuthenticationToken>< TNS:DeveloperToken>删节< / TNS:DeveloperToken>< TNS:密码>< / TNS:密码>< TNS:用户名>< / TNS:用户名>< / env:标题>< env:正文>< tns:GetUserRequest
xmlns =" https://guideads.microsoft.com/Customer/v11">< / tns:GetUserRequest>< / env :Body>< / env:Envelope>

对clientcenter.api.bingads.microsoft.com(httpclient)的HTTPI POST请求

SOAP响应(状态500)

< s:Envelope xmlns:s =" http://schemas.xmlsoap.org/soap/envelope/">< s:Body>< s:Fault>< faultcode> ; s:服务器< / faultcode>< faultstring xml:lang =" en-US">无效的客户端数据。检查SOAP故障详细信息以获取更多
信息< / faultstring>< detail>< AdApiFaultDetail xmlns =" https://adapi.microsoft.com"的xmlns:I =" HTTP://www.w3.org/2001/XMLSchema-instance">< TrackingId> 70121b6f-8d93-445d-bd58-245fba373bd6< / TrackingId><错误>< AdApiError>< ;代码> 105< /代码><详细信息
i:nil =" true" />< ErrorCode> InvalidCredentials< / ErrorCode><消息>身份验证失败。提供的凭据无效或帐户处于非活动状态< / Message>< / AdApiError>< /错误>< / AdApiFaultDetail>< / detail>< / s:错误>< / s:Body>< /秒:信封>


即使刷新令牌似乎也不起作用,因为我们收到此错误:


" {\\ \\"error\":\" invalid_grant \",\" error_description \":\"输入参数'refresh_token'或'assertion'的提供值无效。\"}"


过去几年我们一直在为许多其他客户使用相同的流程,所以我们不确定为什么我们会看到这种行为一个特定的Bing Ads登录。实际上,该客户已将其他Bing Ads登录链接到我们的应用程序,并且我们已经能够成功获取所有这些数据的
。我们还要求此客户多次通过这个有问题的登录进行OAuth,我们每次都看到相同的行为。


如有必要,我们很乐意提供单独的代币。


任何帮助都将不胜感激!


解决方案

您是否可以使用与获取访问令牌相同的Microsoft帐户电子邮件地址登录Bing Ads Web应用程序?虽然您可以使用任何Microsoft帐户注册该应用程序,但访问令牌必须代表授权的Bing Ads用户。 


我重新阅读您的帖子,它听起来像您确认用户可以通过用户界面访问Bing Ads。在这种情况下,他们的凭据是否已合并?请注意,版本11不支持

多用户凭据
,因此您通常可以使用版本12。您可以立即开始在沙盒中测试版本12(现在沙盒中支持OAuth)。 


我希望这会有所帮助,


Eric


We're experiencing authentication errors when fetching Bing Ads data for a particular login. Immediately after we complete the server-side OAuth flow, we use the provided access_token to make a request to the GetAccountsInfo request on the Customer Management service, and we immediately get an error 105 failure.

Here's an example request with the tokens stripped out:

SOAP request: https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v11/CustomerManagementService.svc
SOAPAction: "GetAccountsInfo", Content-Type: text/xml;charset=UTF-8, Content-Length: 1976
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="https://bingads.microsoft.com/Customer/v11" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="https://adapi.microsoft.com" xmlns:ins1="https://bingads.microsoft.com/Customer/v11/Entities" xmlns:ins2="https://bingads.microsoft.com/Customer/v11/Exception" xmlns:ins3="http://schemas.datacontract.org/2004/07/System.Collections.Generic" xmlns:ins4="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><env:Header><tns:ApplicationToken></tns:ApplicationToken><tns:AuthenticationToken>REDACTED</tns:AuthenticationToken><tns:DeveloperToken>REDACTED</tns:DeveloperToken><tns:Password></tns:Password><tns:UserName></tns:UserName></env:Header><env:Body><tns:GetAccountsInfoRequest xmlns="https://bingads.microsoft.com/Customer/v11"></tns:GetAccountsInfoRequest></env:Body></env:Envelope>
HTTPI POST request to clientcenter.api.bingads.microsoft.com (httpclient)
SOAP response (status 500)
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Server</faultcode><faultstring xml:lang="en-US">Invalid client data. Check the SOAP fault details for more information</faultstring><detail><AdApiFaultDetail xmlns="https://adapi.microsoft.com" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><TrackingId>fe480158-35a6-4aff-8d4f-cb79fbfe9c64</TrackingId><Errors><AdApiError><Code>105</Code><Detail i:nil="true"/><ErrorCode>InvalidCredentials</ErrorCode><Message>Authentication failed. Either supplied credentials are invalid or the account is inactive</Message></AdApiError></Errors></AdApiFaultDetail></detail></s:Fault></s:Body></s:Envelope>

While debugging, we tried using the GetUser request and got the same result:

SOAP request: https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v11/CustomerManagementService.svc
SOAPAction: "GetUser", Content-Type: text/xml;charset=UTF-8, Content-Length: 1960
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="https://bingads.microsoft.com/Customer/v11" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="https://adapi.microsoft.com" xmlns:ins1="https://bingads.microsoft.com/Customer/v11/Entities" xmlns:ins2="https://bingads.microsoft.com/Customer/v11/Exception" xmlns:ins3="http://schemas.datacontract.org/2004/07/System.Collections.Generic" xmlns:ins4="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><env:Header><tns:ApplicationToken></tns:ApplicationToken><tns:AuthenticationToken>REDACTED</tns:AuthenticationToken><tns:DeveloperToken>REDACTED</tns:DeveloperToken><tns:Password></tns:Password><tns:UserName></tns:UserName></env:Header><env:Body><tns:GetUserRequest xmlns="https://bingads.microsoft.com/Customer/v11"></tns:GetUserRequest></env:Body></env:Envelope>
HTTPI POST request to clientcenter.api.bingads.microsoft.com (httpclient)
SOAP response (status 500)
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Server</faultcode><faultstring xml:lang="en-US">Invalid client data. Check the SOAP fault details for more information</faultstring><detail><AdApiFaultDetail xmlns="https://adapi.microsoft.com" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><TrackingId>70121b6f-8d93-445d-bd58-245fba373bd6</TrackingId><Errors><AdApiError><Code>105</Code><Detail i:nil="true"/><ErrorCode>InvalidCredentials</ErrorCode><Message>Authentication failed. Either supplied credentials are invalid or the account is inactive</Message></AdApiError></Errors></AdApiFaultDetail></detail></s:Fault></s:Body></s:Envelope>

Even refreshing the token doesn't seem to work, as we get this error:

"{\"error\":\"invalid_grant\",\"error_description\":\"The provided value for the input parameter 'refresh_token' or 'assertion' is not valid.\"}"

We've been using the same flow for many other customers over the past few years, so we're unsure why we're seeing this behavior for one particular Bing Ads login. In fact, this customer has linked other Bing Ads logins to our application, and we've been able to successfully fetch data for all of them. We've also asked this customer to go through the OAuth multiple times with this problematic login, and we've seen the same behavior every time.

If necessary, we're happy to provide the tokens separately.

Any help would be greatly appreciated!

解决方案

Can you login to the Bing Ads web application with the same Microsoft account email address as you used to get the access token? Whereas you can register the app using any Microsoft account, the access token has to represent an authorized Bing Ads user. 

I've re-read your post and it does sound like you confirmed the user can access Bing Ads via the UI. In that case have their credentials been consolidated? Please note that version 11 does not support multi-user credentials, so you'll want to use version 12 when its generally available. You can start testing version 12 in sandbox today (and OAuth is now supported in sandbox). 

I hope this helps,

Eric


这篇关于使用全新令牌无效凭据错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆