There are a couple of options here.
1) use a null realm in setCredentials(). This will cause the credentials to match for all realms on the given host.
2) Manually parse the returned 'WWW-Authenticate' header for the realm.
#2 is definitely a hack. This problem is being worked on for the next major HttpClient release (probably 3.0).
Mike
Jorge Morales Pou wrote:
Hi, I have a web-application protected by an ISAPI filter. For loggin off users we have implemented a varying realm system, where the realm changes from time to time, thus it�s not always the same.
We want to access some protected resources from Java, but we dont�t have a realm to use in the HttpClient.getState().setCredentials(...) We want to make a connection to obtain the realm, and then Create the credentials with these realm, and a UsernamePasswordCredentials, but don�t know how to do it. Is it posible to open a connection, and from the 401 response read the realm to use it further?
Thanks from Spain. Saludos, ----------------------- "No hay mujer fea, s�lo belleza ex�tica." ----------------------- Jorge Morales Pou Telef�nica I+D, Madrid.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
