* @throws IOException some other kind of I/O exception
*/
public Response authenticate() throws ClientLoginResponseException, IOException {
GenericUrl url = serverUrl.clone();
url.appendRawPath("/accounts/ClientLogin");
HttpRequest request =
transport.createRequestFactory().buildPostRequest(url, new UrlEncodedContent(this));
request.setParser(AuthKeyValueParser.INSTANCE);
request.setContentLoggingLimit(0);
request.setThrowExceptionOnExecuteError(false);
HttpResponse response = request.execute();
// check for an HTTP success response (2xx)
if (response.isSuccessStatusCode()) {
return response.parseAs(Response.class);
}
// On error, throw a ClientLoginResponseException with the parsed error details