title: How can i retrieve facebook auth code using restfb
body: <p>I am creating a java application with RestFB.
  At <a href="https://developers.facebook.com/docs/authentication/" rel="nofollow">this</a> url, Facebook explains how to authenticate using facebook connect.</p>
  
  <p>Basically, the steps are the following:</p>
  
  <ol>
  <li>Redirect to facebook as the example. </li>
  </ol>
  
  <p><a href="https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&amp;redirect_uri=YOUR_URL&amp;scope=email,read_stream" rel="nofollow">https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&amp;redirect_uri=YOUR_URL&amp;scope=email,read_stream</a></p>
  
  <p>2.If I invoke a HTTP request using the above URL, I get the following <a href="http://pastebin.com/JABNzNLt" rel="nofollow">html</a> response.</p>
  
  <p>3.But if I invoke the above link via my browser, I get the following <a href="http://www.facebook.com/?ref=tn_tnmn&amp;code=AQDzn5fVtYIMJ1mVhcmZd15fxZYq57jbwrcIGOJZmvC4FuJY500N9rxSNczcJhyVpnnOLbNIgHtvdZw4JqjdJbq1oyTKUa4WBuQipfxvjDFRgHsYHlu91sMK8o65bL7BKC0bwMJg16LWKbZsipE25jsb5QA9On1HLMLcnPqamuv8Ev0jgzBaXPR4gHRLJgXdmiW_poC_FqHPphpZD8tZFgO-#_=_" rel="nofollow">url</a> which contains the OAuth code. </p>
  
  <p>What I really want is the OAuth code which I am able to obtain only through the browser <a href="http://www.facebook.com/?ref=tn_tnmn&amp;code=AQDzn5fVtYIMJ1mVhcmZd15fxZYq57jbwrcIGOJZmvC4FuJY500N9rxSNczcJhyVpnnOLbNIgHtvdZw4JqjdJbq1oyTKUa4WBuQipfxvjDFRgHsYHlu91sMK8o65bL7BKC0bwMJg16LWKbZsipE25jsb5QA9On1HLMLcnPqamuv8Ev0jgzBaXPR4gHRLJgXdmiW_poC_FqHPphpZD8tZFgO-#_=_" rel="nofollow">3</a>, I am unable to get that code via <a href="http://pastebin.com/JABNzNLt" rel="nofollow">2</a>. I would like to programatically fetch the OAuth code in my standalone java program. How do I achieve that?</p>