/**
* {@inheritDoc}
*/
public Token getAccessToken(Token requestToken, Verifier verifier) {
OAuthAppSettings config = getTunedOAuthAppSettings();
OAuthRequest request = new OAuthRequestImpl(api.getAccessTokenVerb(), api.getAccessTokenEndpoint());
request.addQuerystringParameter(AgoravaConstants.CLIENT_ID, config.getApiKey());
request.addQuerystringParameter(AgoravaConstants.CLIENT_SECRET, config.getApiSecret());
request.addQuerystringParameter(AgoravaConstants.CODE, verifier.getValue());
request.addQuerystringParameter(AgoravaConstants.REDIRECT_URI, config.getCallback());
if (config.hasScope())
request.addQuerystringParameter(AgoravaConstants.SCOPE, config.getScope());
Response response = request.send(); //todo:should check return code and launch ResponseException if it's not 200
return api.getAccessTokenExtractor().extract(response.getBody());
}