"error" : "invalid_grant", "error_description" : "Invalid code." while authenticating

225 views
Skip to first unread message

Mhamad Canaan

unread,
Apr 29, 2016, 4:08:30 AM4/29/16
to AdWords API Forum
Hi everyone,

I want to authenticate users to access there accounts using the refresh token and the clientCustomerID, but whenever I click allow and go back with the code is the url this error pops up.
what is wrong?

Yin Niu

unread,
Apr 29, 2016, 10:32:19 AM4/29/16
to adwor...@googlegroups.com
Hi, 

Could you be more specific about your problem? Are you having problem generating refresh token? Please take a look at OAuth 2.0 Authentication guide and you can also try it using OAuth playground

Thanks,
Yin, AdWords API Team. 

Mhamad Canaan

unread,
May 3, 2016, 3:32:43 AM5/3/16
to AdWords API Forum
Hi,

I don't really know what is the problem, I am trying to do the authentication as dynamic, it works when i do it on my local host, the code I wrote takes the user to the AdWords sign in page and lets him accept to manage his account through my software, and it gives back the code and the code is generated into refresh token.

But when I integrated this code into the web application it gave me this error and I don't understand what it is, it is giving back the code but cant generate it into refresh token.

Mhamad Canaan

unread,
May 3, 2016, 4:41:57 AM5/3/16
to AdWords API Forum
Hi, 

Thank you for your help but it turned out that i was calling the function twice that is why it gave me this error. Thanks a lot.

Umesh Dengale

unread,
May 3, 2016, 9:33:46 AM5/3/16
to AdWords API Forum
Hello,

I am glad you found the fix. Please let us know if you need any other help with AdWords API.

Thanks,
Umesh, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages