@InjectWithQualifier
OAuthAppSettings config;
@Override
public Token getAccessToken(Token requestToken, Verifier verifier) {
OAuthRequest request = new OAuthRequestImpl(api.getAccessTokenVerb(), api.getAccessTokenEndpoint());
request.addBodyParameter(AgoravaConstants.CLIENT_ID, config.getApiKey());
request.addBodyParameter(AgoravaConstants.CLIENT_SECRET, config.getApiSecret());
request.addBodyParameter(AgoravaConstants.CODE, verifier.getValue());
request.addBodyParameter(AgoravaConstants.REDIRECT_URI, config.getCallback());
request.addBodyParameter("grant_type", "authorization_code");
if (config.hasScope())
request.addBodyParameter(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());
}