title: Facebook Connect with NodeJS
body: <p>I am creating a web app with express.js and angular,js, where the client authenticates via facebook. For facebook authentication I use <a href="https://github.com/amachang/facebook-node-sdk" rel="nofollow">facebook-node-sdk</a> to connect with facebook and retrieve details.</p>
  
  <p>The code works well when authentication is made via a <code>url</code> redirect. But the same code returns no result when I send a <code>POST</code> request from client to invoke the same code</p>
  
  <p>Server Code</p>
  
  <pre><code>app.post('/login', Facebook.loginRequired(), function(req, res){
    var result = {};
    req.facebook.api('/me', function(err, user) {
        console.log(user);
        if(user !== undefined){
          result.status = 1;
          result.name = user.name;
          res.contentType('json');
          res.write(JSON.stringify(result));
          res.render('index')
          res.end();
        }
        else{
          result.status = 0;
          result.name = "Error signing into Facebook";
          res.contentType('json');
          res.write(JSON.stringify(result));
          res.render('/')
          res.end();
        }
      });
  });
  </code></pre>
  
  <p>I have no error when the above code is invoked. <code>console.log</code> shows: </p>
  
  <blockquote>
    <p>POST /login 302.</p>
  </blockquote>
  
  <p>So is it possible to authenticate facebook via <code>POST</code> request or should it be always a direct URL request? If so any option to authenticate via POST?</p>