redirect_uri mismatch: Google Oauth


#1

I am using the following function in Server.js:

if (Meteor.isServer) {
    Meteor.startup(function() {
        // code to run on server at startup
        Accounts.loginServiceConfiguration.remove({
        	service:"google"
        })
        Accounts.loginServiceConfiguration.insert({
            service: "google",
            clientId: "",
            secret: ""
        });
    });
}

with the proper clientid and secret.

And here are the credentials at google developer console:

Redirect URIs
https://localhost:3000/_oauth/google?close
JavaScript origins
https://localhost:3000

But, when I try to log in, it provides the following error : 400 redirect_uri_mismatch

What is this?


#2

You need to use http:// (not https://) for localhost redirects.

Also, not sure about the ?close parameter you’ve got. The recommendation is

http://localhost:3000/_oauth/google