Hi, The issue here is that your application in Cloud Console is a *Web* application so during the flow there's an attempt to redirect to the URL you entered when you set up the application.
Per the PHP OAuth2 Wiki article<https://github.com/googleads/googleads-php-lib/wiki/Using-OAuth-2.0>, if you are using the *GetRefreshToken.php* example you will need to create a *Native Application*. This will still allow you to request offline access but will send the redirect to your local host. Please give that a try and let me know if that resolves the issue for you. Thanks, Josh, AdWords API Team On Monday, January 6, 2014 1:02:00 PM UTC-5, Jonathan Martins wrote: > > I used my MCC account to generate my WEB Application. So now i have access > to the client_id and the client_secret: > > client_id = "450382064948.apps.googleusercontent.com" > client_secret = "xxxxxxxxxxxxxxxxxxxxx" > > I'm using the PHP client library and the GetRefreshToken.php dont give me > a refresh token immediately it show me this: > > Log in to your AdWords account and open the following URL: > https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=450382064948.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Fwww.metriks.net&scope=https%3A%2F%2Fadwords.google.com%2Fapi%2Fadwords%2F&access_type=offlineAfter > approving the token enter the authorization code here: > > After a click on this link I get a page with: > > This app would like to: > Manage your AdWords campaigns > Accept > > After click on Accept the pages reload and than i'm able to take a code > (refresh_token?). > > "http://www.metriks.net/?code=4/_7aYKqOsCqlxXKAkq3q2m8v2K6..."" > > I put that token in auth.ini, but i'm still getting "invalid_grant" > message... > > Otherwise thinking that this code is not the refresh_token, i'm edit the > GetRefreshToken.php and replace the $code var by the code above on line 65. > Its not working too... Now i'm getting a error_description that said > "Invalid Code". > > ----------- > In this post Jur has a similar problem: > https://groups.google.com/forum/#!msg/adwords-api/aucqEmo0m5w/VYBcfHNHxzIJ > > But in my case I cant see the message after click accept: "Please copy > this code, switch to your application and paste it there:" Is simple > redirect to my Redirect_URI with the code parameter. > ------------- > > Thats for HELP, i'm stuck... > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://googleadsdeveloper.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com 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 adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.