Why is Redirect URL in Google Drive modified when app is called from the Google Drive UI?

Question!

I'm running the PHP DrEdit example.

When I visit my app directly, I am able to authenticate via Google. However when I try to visit it through the Google Drive UI: by hiting create and selecting the app, I get a 400 error

Error: redirect_uri_mismatch
The redirect URI in the request: http://site.com did not match a registered redirect URI
Learn more

The redirect uri in all of my config files are actually http://site.com/app NOT http://site.com

The only place http://site.com is set is in "Javascript Origins" and it won't accept http://site.com/app as a valid url.

Anyone know why the redirect url is being modified to http://site.com or if there's somewhere I can modify this?

Thanks



Answers

The DrEdit sample uses http://site.com as the Redirect URI, so you should set the same value in the config files.

All steps to setup the application are listed in the docs, please make sure you are following them:

https://developers.google.com/drive/examples/php#setting_up_this_sample_application



This video can help you solving your question :)
By: admin