meteorgoogle-apigoogle-oauthmeteor-accountsngrok

Why isn't my Google OAuth configuration not working?


Ever since Google made some minor changes to their Google OAuth API side, I haven't been able to correctly configure and use the Google OAuth, indicated by the error message: Error: redirect_uri_mismatch The configurations fail, despite me following the setting up Google OAuth instructions in detail.

Can someone kindly help point out what I am doing wrong or missing?

Just in case you aren't familiar with what I mean by the Google OAuth instructions, find below an image illustrating what I mean:

enter image description here

I skip 2. "Create Project" (since the project already has a priorly recorded name) and head on to step 3.

an indicating what my OAuth Consent screen looks like

After entering an email address and the product name as suggested in step .3 , I save.

I carry out steps 4, 5 without any problem.

On step 6 I realise that my configuration instructions isn't up to date, because as at this point, I notice that Google has added a few Mandatory fields to be filled in. A person now has to Authorize Javascript Origins as shown in the image below. Note the https://3e908b9b.ngrok.io (fictitious for this case) link that I filled in.

enter image description here

I click the Authorized domains list link that takes me back to the OAuth Consent Screen and paste in the exact same link https://3e908b9b.ngrok.io as seen in the image below, then save as seen in the image below.

enter image description here

Doing this, permits me to complete the process successfully as seen in the image below finalised by clicking Save.

enter image description here

On my Meteor app side, I finalise by filling in the Client ID and the Client Secret details, as seen in the image below.

enter image description here

When i later try to login using Google OAuth I get this frustrating error message Seen below..enter image description here

This is an issue i never used to get untill Google made a few changes on their side. I cant seem to figure this out.

Any help would be greatly appreciated!


Solution

  • The error message tells you exactly what the problem is the redirect uri you are sending from https://3XXXXXngrok.io/_oauth/google does not match one of the ones you have supplied in the Google Developer console for your project.

    You appear to have set https://3XXXXXX.io/_oauth/google?close they must exactly match.

    Solution

    simply add https://3XXXXXngrok.io/_oauth/google as a redirect uri or remove ?close from the one you have added