String captchaPath = pairs.get("CaptchaUrl");
StringBuilder captchaUrl = new StringBuilder();
captchaUrl.append(loginProtocol).append("://").append(domainName)
.append(GOOGLE_ACCOUNTS_PATH).append('/').append(captchaPath);
return new CaptchaRequiredException("Captcha required",
captchaUrl.toString(),
pairs.get("CaptchaToken"));
} else {
return new AuthenticationException("Error authenticating " +