title: twitter4j getOauthAccessToken giving exception
body: <p>I am trying to get a user's access token using twitter4j in my appengine project. My code is below</p>
  
  <pre><code>    HttpSession session = req.getSession();
      String tokenCopy = (String) session
              .getAttribute(Constants.TOKEN_SESSION_KEY);
      String tokenSecretCopy = (String) session
              .getAttribute(Constants.TOKENSECRET_SESSION_KEY);
  
      String oauth_token = req.getParameter("oauth_token");
      //The above is the same as the tokenCopy, verified by printing.
      String oauth_verifier = req.getParameter("oauth_verifier");
  
      Twitter twitter = new TwitterFactory().getInstance();
      twitter.setOAuthConsumer(Constants.CONSUMER_KEY,
              Constants.CONSUMER_SECRET);
  
      String extraHTML = "NOTHING\n";
  
      try {
          AccessToken accessToken;
          accessToken = twitter
                  .getOAuthAccessToken(tokenCopy, oauth_verifier);
          // accessToken = twitter.getOAuthAccessToken(oauth_verifier);
          // accessToken = twitter.getOAuthAccessToken();
  
          String accessTokenStr = accessToken.getToken();
          String accessTokenSecret = accessToken.getTokenSecret();
          extraHTML = "&lt;p&gt;accessToken = " + accessTokenStr
                  + ", accessTokenSecret = " + accessTokenSecret + "&lt;/p&gt;\n";
  
          // TODO latertwitter.setOAuthAccessToken(accessToken);
      } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          extraHTML = "&lt;pre&gt;" + e.getMessage() + "&lt;/pre&gt;\n";
      }
  </code></pre>
  
  <p>Sadly, when my code runs, I always get the exception</p>
  
  <pre><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></pre>
  
  <p>I know my <code>CONSUMER_KEY</code> and <code>CONSUMER_SECRET</code> are correct (I used them to create the twitter auth url and that works well). What am I missing here? Should I be passing something else to the call to <code>getOAuthAccessToken()</code> ?</p>
  
  <p>Thanks.</p>