title: Why is requesting for authorization of my Twitter app for a new user generating a PIN?
body: <p>I've created a twitter app and I have all the credentials (access token, secret, consumer key and secret). I'm using <a href="https://github.com/abraham/twitteroauth/releases" rel="nofollow noreferrer">Abraham's Twitter Oauth</a>. I've been able to get the application running but I am currently unable to Authorize a new account successfully. Instead, it is requesting for a new user to input a PIN generated after the user has granted access, before the authorization is complete. 
  <a href="https://i.stack.imgur.com/P0d7K.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P0d7K.jpg" alt="See Image"></a></p>
  
  <p>I've done some lookup on the internet and it pointed out to Twitter.com's manual <a href="https://dev.twitter.com/oauth/pin-based" rel="nofollow noreferrer">here</a> and <a href="https://dev.twitter.com/web/sign-in/implementing" rel="nofollow noreferrer">here</a>. From what I've been able to read up, <a href="https://dev.twitter.com/web/sign-in/implementing" rel="nofollow noreferrer">Implementing a desktop sign in request</a> requires <code>oauth_callback</code> value. I've tried to add a value to this parameter, but it returns an error: <code>Fatal error: Uncaught exception 'Abraham\TwitterOAuth\TwitterOAuthException' with message '&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;hash&gt; &lt;error&gt;Desktop applications only support the oauth_callback value 'oob'&lt;/error&gt; &lt;request&gt;/oauth/request_token&lt;/request&gt; &lt;/hash&gt; '</code>, but if I don't add a value to the <code>oauth_callback</code> parameter, it redirects to Twitter.com's authorization page successfully, but then, generates a PIN which will be required to be filled in the application.
  I sincerely do not know how to go round this, any help will be much appreciated. 
  Here's my code below:</p>
  
  <pre><code>require_once "twitteroauth/autoload.php";
  use Abraham\TwitterOAuth\TwitterOAuth;
  //Check if form was submitted
  if(isset($_GET['activate-account']) &amp;&amp; $_GET['activate-account'] == 'true'){
  session_start();
  
  //Get App Details (Consumer key and secret) from DB
  $appID = 1;
  $consumerKey = getAutoTweetPart($appID, 'consumer_key');
  $consumerSecret = getAutoTweetPart($appID, 'consumer_secret');
  
  $callBack = '';
  
  $connection = new TwitterOAuth($consumerKey, $consumerSecret);
  
  $request_token = $connection-&gt;oauth('oauth/request_token', array('oauth_callback' =&gt; $callBack));
  
  $_SESSION['oauth_token'] = $request_token['oauth_token'];
  $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
  
  $url = $connection-&gt;url('oauth/authorize', array('oauth_token' =&gt; $request_token['oauth_token']));
  header('Location: '. $url);
  }
  </code></pre>