use of net.oauth.client.OAuthClient in project ngtesting-platform by aaronchen2k.
the class AtlassianOAuthClient method swapRequestTokenForAccessToken.
public String swapRequestTokenForAccessToken(String requestToken, String tokenSecret, String oauthVerifier) {
try {
OAuthAccessor accessor = getAccessor();
OAuthClient client = new OAuthClient(new HttpClient4());
accessor.requestToken = requestToken;
accessor.tokenSecret = tokenSecret;
OAuthMessage message = client.getAccessToken(accessor, "POST", ImmutableList.of(new OAuth.Parameter(OAuth.OAUTH_VERIFIER, oauthVerifier)));
return message.getToken();
} catch (Exception e) {
throw new RuntimeException("Failed to swap request token with access token", e);
}
}
Aggregations