commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <>
Subject Re: [HttpClient] Trying to obtain a realm to send the correct authentication
Date Wed, 03 Mar 2004 17:50:26 GMT
Hi Jorge,

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).


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:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message