params.put("grant_type", singletonList("authorization_code"));
params.put("code", singletonList(authorizationCode));
if (redirectUri!=null)
params.put("redirect_uri", singletonList(redirectUri));
OauthTokenDetail resp = bees.formUrlEncoded(gcUrl+"/oauth/token", null, params).bind(OauthTokenDetail.class,bees);
return toToken(resp);
} catch (IOException e) {
throw new OauthClientException("Failed to exchange authorization code to access token",e);
}
}