}
protected String getAuth(String id, String pwd, String service) {
try {
Client client = new CommonsClient();
Formatter f = new Formatter();
f.format(
"Email=%s&Passwd=%s&service=%s&source=%s",
URLEncoder.encode(id, "utf-8"),
URLEncoder.encode(pwd, "utf-8"),
(service != null) ? URLEncoder.encode(service, "utf-8") : "",
URLEncoder.encode(Version.APP_NAME, "utf-8"));
StringRequestEntity stringreq = new StringRequestEntity(f.toString());
String uri = "https://www.google.com/accounts/ClientLogin";
RequestOptions options = client.getDefaultRequestOptions();
options.setContentType("application/x-www-form-urlencoded");
ClientResponse response = client.post(uri, stringreq, options);
InputStream in = response.getInputStream();