BadAuthentication error when using AdWordsUser from .NET client lib 12.2.0.0

120 views
Skip to first unread message

Marijn

unread,
Jun 30, 2011, 5:59:18 AM6/30/11
to adwor...@googlegroups.com
Hi there,
 
We are in the process of supporting the latest Adwords API version. In doing so, we replaced our client lib (downloaded source code which supports the v200909 api) with the binary of Google.AdWords.dll v12.2.0.0.
 
This broke a lot of things we should be able to fix.
However, our implementation of instantiating an AdWordsUser class throws an exception which we don't know how to solve.
 
We use this code:
 
// Init header
Dictionary<string, string> headers = new Dictionary<string, string>();
headers.Add("useragent", xxxx);
headers.Add("developerToken", xxxx);
headers.Add("applicationToken", xxxx);
headers.Add("email", xxxx);
headers.Add("password", xxxx);
headers.Add("clientCustomerId", xxxx);
// Create the user
AdWordsUser adWordsUser = new AdWordsUser(headers);
 
The last line throws this exception:
Message: "AuthToken login failed. See ErrorCode for more details."
Errorcode: Google.Api.Ads.Common.Lib.AuthTokenErrorCode.BadAuthentication
InnerException: {"The remote server returned an error: (403) Forbidden."}
 
When we use this code with the deprecated Google.AdWords.dll v11.3.0 assembly, this exception is not thrown an we are able to use the AdWordsUser instance to access the API's services.
 
Can anyone shed some light on this?
 
We need to remove our dependencies to V13 ReportingServices. So we could use this v11.3.0 client lib. But the follwing page seems to tell me that this will be sunset soon aswell: http://adwordsapi.blogspot.com/2011/05/update-on-adwords-api-v201101-sunset.html.

Anash P. Oommen

unread,
Jul 4, 2011, 1:04:18 AM7/4/11
to adwor...@googlegroups.com
Hi Marjin,

I think the v12.2.0 has an issue where the header cases got messed up, try making the first letter of each header key caps (Email, Password, etc.)

Cheers,
Anash P. Oommen,
AdWords API Advisor.

ewittas

unread,
Jul 4, 2011, 2:06:11 AM7/4/11
to AdWords API Forum
Hi guys,

I am using v13 to get API access of adwords account. I am getting same
above issue "AuthTocken Login failed" on code lline,
AdWordsUser user = new AdWordsUser(headers);.

Can any one help me out?


On Jul 4, 10:04 am, "Anash P. Oommen" <anash.p.oom...@google.com>
wrote:

Anash P. Oommen

unread,
Jul 5, 2011, 2:57:41 AM7/5/11
to adwor...@googlegroups.com
Hi,

I've added a detailed troubleshooting guide on https://groups.google.com/forum/#!topic/adwords-api/5q52k_AJC-Q.

Marijn

unread,
Jul 5, 2011, 10:52:49 AM7/5/11
to adwor...@googlegroups.com
Hi Anash,
 
Thank you, you solved my problem!
Reply all
Reply to author
Forward
0 new messages