return getAccessToken(requestToken, verifier, 2, TimeUnit.SECONDS);
}
public Token getAccessToken(Token requestToken, Verifier verifier, RequestTuner tuner) {
LOGGER.fine("obtaining access token from " + api.getAccessTokenEndpoint());
OAuthRequest request = requestFactory(api.getAccessTokenVerb(), api.getAccessTokenEndpoint());
request.addOAuthParameter(AgoravaConstants.TOKEN, requestToken.getToken());
request.addOAuthParameter(AgoravaConstants.VERIFIER, verifier.getValue());
LOGGER.fine("setting token to: " + requestToken + " and verifier to: " + verifier);
addOAuthParams(request, requestToken);
appendSignature(request);
Response response = request.send(tuner);
//todo:should check return code and launch ResponseException if it's not 200
return api.getAccessTokenExtractor().extract(response.getBody());
}