title: Passport - is there a way to override redirect on first authenticate call?
body: <p>I have a very peculiar requirement in which I need to perform authentication inside an iframe. Most signin providers obviously prevent their authentication pages from running inside iframes, so the only way around this is to trigger the redirect on the page that contains the iframe. To do this, I was looking for a way to override <code>passport.authenticate</code>'s behaviour so that it would return a 200 status and the redirect URL as a parameter and thus allow it to be called by javascript code that would then use the response to redirect the parent page.</p>
  
  <p>So for example, I was trying to customize Twitter authorization:</p>
  
  <pre><code>//Callback is not called since redirect is followed automatically
  app.get('/auth/twitter',
    passport.authenticate('twitter'),
    function(req, res) {
      //set status to 200 and return url as parameter instead 
      //of performing redirect
    });
  
  //This callback route is easier to customize since it 
  //doesn't do any implicit redirects
  app.get('/auth/twitter/callback', 
    passport.authenticate('twitter', { successRedirect: '/',
                                       failureRedirect: '/login' }));
  </code></pre>
  
  <p>I know that this is a very uncommon use case, but I just want to know if there's a way to configure or override this behaviour. Thanks.</p>