El information aquí me ayudó a conseguir mi aplicación Android trabajar con Kerberos. Aquí hay un link a un proyecto en el que estoy trabajando. Hace la autenticación de Kerberos. Aquí está el código pertinente:
UsernamePasswordCredentials creds =
new UsernamePasswordCredentials(username, password);
DefaultHttpClient client = getHttpClient();
client.getCredentialsProvider().setCredentials(SERVER_AUTH_SCOPE, creds);
boolean authWorked = false;
try{
HttpGet get = new HttpGet(AUTH_URI);
HttpResponse resp = client.execute(get);
authWorked = hasValidCookie();
}
/*catch(AuthenticationException e){
Log.e("TAG", "Auth exceptions");
//TODO maybe do something?
}*/
catch(IOException e){
Log.e("TAG", "IOException exceptions");
//TODO maybe do something?
}
aquí es el método getHttpClient()
:
public static DefaultHttpClient getHttpClient(){
if(httpClient == null){
httpClient = new DefaultHttpClient();
final HttpParams params = httpClient.getParams();
HttpConnectionParams.setConnectionTimeout(params, REGISTRATION_TIMEOUT);
HttpConnectionParams.setSoTimeout(params, REGISTRATION_TIMEOUT);
ConnManagerParams.setTimeout(params, REGISTRATION_TIMEOUT);
}
return httpClient;
}
aquí es hasValidCookie()
private static final String LOGIN_COOKIE_NAME = "CGISESSID";
private static boolean hasValidCookie(){
for(Cookie cookie: getHttpClient().getCookieStore().getCookies()){
if(cookie.getName().equals(LOGIN_COOKIE_NAME))
{
return true;
}
}
return false;
}
Sería de gran ayuda, si usted ha descrito, lo _exactly_ su problema. ¿Qué has intentado? ¿Puedes dar algunos ejemplos de código? ¿Has logrado usar xmlrpc sin autenticación en primer lugar? ... – Fildor