String permissions = rs.getString("permissions");
String verifier = rs.getString("verifier");
String tokenConsumerKey = rs.getString("consumer_key");
if (consumerKey != null && !tokenConsumerKey.equals(consumerKey)) {
throw new OAuthException(HttpURLConnection.HTTP_UNAUTHORIZED, "No such consumer key "+consumerKey);
}
OAuthRequestToken newToken = new OAuthRequestToken(token, secret, callback,
scopes == null ? null : new String[] {scopes},
permissions == null ? null : new String[] {permissions},
-1, getConsumer(tokenConsumerKey));
newToken.setVerifier(verifier);
return newToken;
} else {
throw new OAuthException(HttpURLConnection.HTTP_UNAUTHORIZED, "No such consumer key "+consumerKey);
}
} catch (SQLException ex) {
throw new OAuthException(HttpURLConnection.HTTP_UNAUTHORIZED, "No such consumer key "+consumerKey);
}
}