.buildQueryMessage();
OAuthClient client = new OAuthClient(new URLConnectionClient());
String app = Utils.findCookieValue(req, "app");
OAuthAccessTokenResponse oauthResponse = null;
Class<? extends OAuthAccessTokenResponse> cl = OAuthJSONAccessTokenResponse.class;
if (Utils.FACEBOOK.equals(app)) {
cl = GitHubTokenResponse.class;
} else if (Utils.GITHUB.equals(app)) {
cl = GitHubTokenResponse.class;
}
oauthResponse = client.accessToken(request, cl);
oauthParams.setAccessToken(oauthResponse.getAccessToken());
oauthParams.setExpiresIn(oauthResponse.getExpiresIn());
oauthParams.setRefreshToken(Utils.isIssued(oauthResponse.getRefreshToken()));
return new ModelAndView("get_resource");
} catch (ApplicationException e) {
oauthParams.setErrorMessage(e.getMessage());