Аутентификация Google ClientLogin

Я пытаюсь выполнить аутентификацию с помощью ClientLogin

URL url = new URL("https://www.google.com/accounts/ClientLogin");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("POST");

connection.setRequestProperty("Email", "testonly%2Ein%2E2011%40gmail%2Ecom");
connection.setRequestProperty("Passwd", "mypass");
connection.setRequestProperty("accountType", "HOSTED");
connection.setRequestProperty("service", "apps");
connection.connect();

, но получаю Error = BadAuthentication . Как мне исправить свой код?

6
задан Stan Kurilin 17 March 2011 в 18:06
поделиться