Todd Leach February 2016

Google Drive REST API DriveQuickstart Error 400: redirect_uri_mismatch JAVA

I've gone through all of the steps listed here: and now when I run my project, it gives me a 400 error, redirect url mismatch on Chrome.

I've tried following multiple instructions from here: Google OAuth 2 authorization - Error: redirect_uri_mismatch but I am having two key problems: When I go to register the URI in my developers console, I have no field to put the redirect URI's in, and my redirect URI is different every time, from what I can tell.

How can I add a redirect URI, and also whenever I run the program, the redirect URI seems to be different every time.

Taken from the console ( run 1, and run 2):


So I have no idea how to account for dynamic redirect URI's.

My code matches the quickstart/java link exactly

Here is the console output:

Feb 08, 2016 7:42:38 PM setPermissionsToOwnerOnly
WARNING: unable to change permissions for everybody: C:\Users\Speedy Octopus\.credentials\drive-java-quickstart
Feb 08, 2016 7:42:38 PM setPermissionsToOwnerOnly
WARNING: unable to change permissions for owner: C:\Users\Speedy Octopus\.credentials\drive-java-quickstart
2016-02-08 19:42:38.378:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
2016-02-08 19:42:38.378:INFO::jetty-6.1.26
2016-02-08 19:42:38.388:INFO::Started SocketConnector@localhost:62210
Please open the following address in your browser:        


Dallen February 2016

I ran into the exact same problem the other day, basically google is not very clear about the fact that they need both the address that they will be returning to and the callback uri. In your development console where you have registered your project, under 'credentials', 'Authorized redirect URIs' you need to add your callback uri, in this case http://localhost:62210/Callback. Without that google cannot be sure it is returning to the right uri.

Post Status

Asked in February 2016
Viewed 3,293 times
Voted 7
Answered 1 times


Leave an answer