Ok, I have figured out a much better way to do this.  

I assume that copying the authorizeUrl into a browser, and copying the 
resulting authorizationCode into a Windows command line all has to be done 
within a single user session.  And the line:

String authorizationCode = new BufferedReader(new 
InputStreamReader(System.in)).readLine();

stops execution until the user pastes the authorizationCode in.  

Instead of jumping through a ton of hoops necessary to run 
GetRefreshToken.java at the command line, I simply ripped out the following 
line:

String authorizationCode = new BufferedReader(new 
InputStreamReader(System.in)).readLine();

and replaced it with a line that reads the authorizationCode from a file 
that I have pasted the authorizationCode to.

I just run it all in my IDE in debug mode with a breakpoint set immediately 
before the file read.

That way it all happens within one user session, which apparently is 
required, and no CLASSPATH hoops to jump through!

Anyway, it works smoothly, and I now have the credential.getRefreshToken().




On Wednesday, March 19, 2014 1:04:46 PM UTC-7, steve....@revvim.com wrote:

> I have a api.adwords.clientId and a api.adwords.clientSecret obtained from:
>
>
> https://console.developers.google.com/project/apps~astute-being-524/apiui/credential
>
> I have pasted the clientId and clientSecret into the appropriate spots in 
> ads.properties file.
>
> I have run GetRefreshToken.java and at line 78,  am displayed a url to 
> past in a browser.
>
> I paste the url in a browers and see:
>
> Error: redirect_uri_mismatch
>
> Please let me know what I need to do to correct the situation.  I really 
> need to get this migration complete before the Sunset date.
>
> Thanks.
>
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 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/d/optout.

Reply via email to