title: Missing required parameter: redirect_uri with passport-google-oauth
body: <p>Using <code>passport-google-oauth: "0.2.0"</code> in my MEAN Stack application (found here: <a href="https://github.com/jaredhanson/passport-google-oauth" rel="noreferrer">https://github.com/jaredhanson/passport-google-oauth</a>). When I run the application and attempt to sign in with a Google API this error is returned</p>
  
  <blockquote>
    <ol start="400">
    <li>That’s an error.</li>
    </ol>
    
    <p>Error: invalid_request</p>
    
    <p>Missing required parameter: redirect_uri</p>
    
    <p>Request Details 
    scope=<a href="https://www.googleapis.com/auth/plus.login" rel="noreferrer">https://www.googleapis.com/auth/plus.login</a>
    response_type=code 
    redirect_uri=
    client_id=xxxx-xxxx.apps.googleusercontent.com</p>
  </blockquote>
  
  <p>The redirect param is here
  <code>passport-init.js</code></p>
  
  <blockquote>
    <p>var GoogleStrategy = require('passport-google-oauth').OAuth2Strategy;</p>
    
    <p>var GOOGLE_CLIENT_ID = "xxx-xxx.apps.googleusercontent.com";
    var GOOGLE_CLIENT_SECRET = "xxxx";</p>
    
    <p>passport.use(new GoogleStrategy({<br>
    clientID: GOOGLE_CLIENT_ID,<br>
    clientSecret: GOOGLE_CLIENT_SECRET,<br>
    callbackUrl: "<a href="http://127.0.0.1:3000/auth/google/oauth2callback" rel="noreferrer">http://127.0.0.1:3000/auth/google/oauth2callback</a>"  },
    function(accessToken, refreshToken, profile, done){
        done(null,profile); } ));</p>
  </blockquote>
  
  <p>The routes are here <code>authenticate.js</code></p>
  
  <blockquote>
    <p>router.get('/google', passport.authenticate('google', 
    { scope: ['<a href="https://www.googleapis.com/auth/plus.login" rel="noreferrer">https://www.googleapis.com/auth/plus.login</a>']}), 
    function (req, res){ });</p>
    
    <p>router.get('/google/oauth2callback', passport.authenticate('google', {
    successRedirect: '/auth/success', failureRedirect: '/auth/failure'  })
    , function (req, res) {res.redirect('/');} );</p>
  </blockquote>
  
  <p>I am sure I am missing something simple, but I don't know what to add in this question that will give you the best information. Please ask and I will do my best to answer you. This is what feels like the pertinent data. </p>
  
  <p>Funny thing is if I add the callbackUrl manually then everything works great. I can reach the Google API fine. Then I am given the choice to "allow" or "deny" the request.</p>