1

I'm using nodejs with express 3 and everyauth for google oauth.

Implementation looks like this:

everyauth.google 
/* snip */
.callbackPath('/loggedin');

var app = express();
app.configure(function(){
  /* snip */
  app.use(everyauth.middleware());
}

var server = https.createServer(sslOptions, app);
server.listen(app.get('port'), function(){
// ...
});

Now when I go to the google login path it says:

The redirect URI in the request: http://localhost:4545/loggedin did not match a registered redirect URI

This is correct, because I only added the httpS URI in the google api console.

Please note that I am using HTTPS (secure!) exclusively and everyauth for some reason replaces the https in my url with http.

I think this might be because I am creating the https server after the app.use(everyauth.middleware()); statement. But how do I rewrite the code so everyauth does not ignore the https ?

Is there the possibility of moving the app.use(everyauth.middleware()); statement somewhere after the creation of the https server ?

Thanks in advance!

1 Answers1

1

I was able to get around this issue on Facebook auth by adding the following:

everyauth.facebook.myHostname('https://www.example.com')
C4 - Travis
  • 4,502
  • 4
  • 31
  • 56