Trying to get Auth2 refresh token but get "bad 400: invalid_request"

366 views
Skip to first unread message

1210xin H5

unread,
Mar 14, 2022, 8:37:53 AM3/14/22
to Google Ads API and AdWords API Forum

Google Ads API Forum Advisor

unread,
Mar 14, 2022, 3:36:41 PM3/14/22
to h5.12...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Can you please confirm exactly when this error screen presents? Is it during the refresh token generation process?

Thanks,
Google Logo
Nirmita
Google Ads API Team
 


ref:_00D1U1174p._5004Q2Yl3Du:ref

1210xin H5

unread,
Mar 14, 2022, 9:41:41 PM3/14/22
to Google Ads API Forum Advisor, adwor...@googlegroups.com
Yes, that is correct. 

Google Ads API Forum Advisor <ads...@forumsupport.google> 于2022年3月15日周二 03:36写道:

Google Ads API Forum Advisor

unread,
Mar 15, 2022, 1:59:49 AM3/15/22
to h5.12...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for the reply. I am also a member of the Google Ads API team and let me provide support to your concern.

I would like to inform you first that I am going to delete your initial post as it contains sensitive information like the client ID. Please refrain from posting sensitive information in public forums for security purposes.

Moving forward, I can see that the exact phase where you encountered the error is when generating code for the refresh token. However, I am afraid that our team would not be able to provide support here as the issue is more Oauth2 specific and outside of our scope already. With this, I would suggest reaching out to the Google Cloud platform support team via this link to get support here as they are more equipped to this topic and to address the issue.

Regards,
Google Logo
Ernie John
Google Ads API Team
 


ref:_00D1U1174p._5004Q2Yl3Du:ref

Jason Ryan

unread,
Mar 16, 2022, 2:24:01 PM3/16/22
to Google Ads API and AdWords API Forum
I also ran into this problem.  Google is not very good about updating all their documentation when they deprecate something.

The solution is to modify the "redirect_uri" in your your request url and change it from "urn:ietf:wg:oauth:2.0:oob" to "http://localhost/notarealpage".  That way, when you authorize your app, google will redirect to:

http://localhost/notrealpage?code=<authorization_code>&scope=<scope>

Then you just use that <authorization_code> to proceed with obtaining a refresh token.

Google Ads API Forum Advisor

unread,
Mar 17, 2022, 10:02:52 AM3/17/22
to adwor...@googlegroups.com
Hi Jason,

Thank you for providing your workaround to the issue. However, could you please confirm if you already raised this to the Google Cloud platform support team? We route you to them because the issue is more specific on OAuth2, and this is out of our scope. As mentioned by my colleague. With this, please get back to us after raising this to the Google Cloud platform support team.

Best regards,
Google Logo
Jinky
Google Ads API Team
 

 

ref:_00D1U1174p._5004Q2Yl3Du:ref
Reply all
Reply to author
Forward
0 new messages