Hi, Thanks for the helpful tips. Point #2 is covered in the OAuth guide for the web flow <https://developers.google.com/accounts/docs/OAuth2WebServer#formingtheurl>, in case that's helpful.
Note that you shouldn't have to revoke the application before getting another refresh token. I personally have multiple refresh tokens for the same application on several of my accounts. Cheers, Josh, AdWords API Team On Tuesday, March 31, 2015 at 7:25:24 AM UTC-4, Mark wrote: > > I have no affiliation with google. Just a fellow user like you. In my > experience there are 2 cases where the refresh doesn't work: > > 1. When you exchange their code with non-empty scopes as a parameter. Make > sure to leave this blank (not sure which client library you're using) and > only include non-empty scopes when you create the initial redirect url. > 2. When the redirect url parm of the exchange code request is not the same > as the redirect url you provided the user (must be identical) > > Also, make sure to start over FRESH, ie log in and visit > https://security.google.com/settings/security/permissions and REVOKE your > application, then repeat the process. > > I also can't find this in the documentation or anywhere else in the forum; > I just had to figure it out painfully. > > On Friday, March 27, 2015 at 11:51:13 AM UTC-7, Sean Gottschalk wrote: >> >> Hello, >> >> I'm trying to create a refresh token for a client using my adwords >> developer credentials but when I enter the generated code I get a 400 >> invalid grant error from the adwords API. >> >> I logged into my developer console on my MCC account and verified that I >> have the following OAuth credentials: >> >> Client ID >> 379545466128.apps.googleusercontent.com >> Client secret >> <secret> >> Redirect URIs >> >> urn:ietf:wg:oauth:2.0:oob >> http://localhost >> >> I am using this example to generate the token, and have successfully >> generated tokens for other client accounts in the past: >> >> https://github.com/googleads/googleads-java-lib/blob/master/examples/dfp_axis/src/main/java/dfp/axis/auth/GetRefreshToken.java >> >> This is the url that I have the clients visit to generate the token: >> >> https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=379545466128.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://adwords.google.com/api/adwords >> >> I'm not sure where to go from here, does anyone have any debugging tips? >> >> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/130ffbcb-d615-4ca1-8a79-472195dabca3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
