Google Drive API OAuth 2.0; Error: origin_mismatch

bluejayke picture bluejayke · Mar 15, 2013 · Viewed 26.8k times · Source

I'm having trouble creating a valid google drive API for my website. I may sound like a complete noob, but I created a file called quickstart.html in my main ftp directory and copied and pasted the code from https://developers.google.com/drive/quickstart-js#step_1_enable_the_drive_api and replaced the client id with my client id, and in my settings I set the Javascript Origins URL to my main url (www.domainname.com), I have a separate index page for that domain, so to access google drive do I just go to http://domainname.com/quickstart.html? Because when I do that and click "Authorize" I get the google Origin Mismatch error. Can anyone help me please?

Answer

user3184979 picture user3184979 · Jan 11, 2014

in Api Console replace your redirect urls to http and remove https and You can also use 'scope': 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email' . This solution worked for me.