title: Android: authorize application to connect to twitter
body: <p>I am using twitter4j and the following code:</p>
  
  <pre><code>public static void OAuthLogin(Activity a) {
      try {
          twitter = new TwitterFactory().getInstance();
          twitter.setOAuthConsumer(key, secret);
          RequestToken requestToken = twitter.getOAuthRequestToken(CALLBACK);
          String authUrl = requestToken.getAuthenticationURL();
          a.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));
      } catch (TwitterException ex) {
          Log.e("in Main.OAuthLogin", ex.getMessage());
      }
  }
  </code></pre>
  
  <p>and getting </p>
  
  <p><code>401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.</code> </p>
  
  <p>when executing <code>twitter.getOAuthRequestToken()</code> Once I remove <code>CALLABACK</code> param everything's fine - I am redirected to twitter login page where I can get PIN. The thing is that I do not want the user to deal with the PIN and be brought back to the app instead. How do I achieve that?</p>
  
  <p><strong>EDIT:</strong> found what's causing the problem and modified the question</p>