String verifier = request.getParameter("oauth_verifier");
twitter.setOAuthConsumer(key, secret);
try {
twitter.getOAuthAccessToken(token, verifier);
User user = twitter.verifyCredentials();
log.info("Twitter user found:" + user.getName());
request.getSession().removeAttribute("requestToken");
String sid = ((Integer) user.getId()).toString();
UserAccount u = new UserAccount(sid, AuthenticationProvider.TWITTER);
// use screen name for uid
u.setName(user.getScreenName());
UserAccount connectr = new LoginHelper().loginStarts(request.getSession(), u);
log.info("User id:" + connectr.getId().toString());
} catch (TwitterException e) {
e.printStackTrace();