setClientId(params.get(constants.getApplicationClientId())).
setClientSecret(params.get(constants.getApplicationClientSecret()))
);
try {
final GoogleTokenResponse tokenResponse = new GoogleAuthorizationCodeTokenRequest(
this.httpTransport,
this.jsonFactory,
secrets.getDetails().getClientId(),
secrets.getDetails().getClientSecret(),
params.get(constants.getApplicationOauthCode()),
constants.getRedirectUri()
).execute();
params.put(constants.getApplicationRefreshToken(), tokenResponse.getRefreshToken());
params.put(constants.getApplicationAccessToken(), tokenResponse.getAccessToken());
} catch (IOException e) {
throw new RuntimeException(e);
}
}