I've been banging my head against the code for a day now, and can't find the solution to this. What I'm trying to achieve is to get access to a non-public Google Calendar via its API. This is a calendar I created for a group, so I have access to its API Console (and everything else). I looked all over, but of course the only working examples I could find were on public API access, which is very simple. I tried using the .NET library for this, as I usually code in C#, but of course that's one of the few libraries in their set that has no examples at all. So I tried the JavaScript libraries. I used the example code on this page:
https://code.google.com/p/google-api-javascript-client/source/browse/samples/authSample.html. The problem is that I keep getting origin mismatch errors. At first I thought this was because Chrome was doing its usual refusal to allow various operations from and to local files, and put the test page on my server. No change. Then I thought it was because the test page wasn't being run with SSL, and ran it in IIS Express locally, with SSL enabled. I placed the URL for it in my Redirect URIs section in the Console, including the port. Still no change. Here is the full error that I received:
I was thinking that maybe it was the redirect URI, which is now listed as "postmessage" in the error details, but I wasn't sure if that only meant the URI was in the message. The example page for the JavaScript library did not set the redirect URI explicitly. I also thought it might be because IIS Express is using a non-standard SSL port. However, I've been trying various fixes without success, so I'm hoping for some guidance. I've also tried out the AuthPlayground, which is admittedly pretty cool, but it doesn't provide a jsFiddle type of experience, where you have the code that just ran to get the expected result. It just sends queries and displays responses. I'll try these ideas out while waiting for replies, but if it's something else entirely, please let me know.