hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Cottenceau ...@mnc.ch>
Subject Re: Basic Authentication
Date Thu, 22 Jun 2006 09:02:12 GMT
Saminda Abeyruwan <saminda 'at' opensource.lk> writes:

[...]

> In my servlet, i have access to *HttpServletRequest*
> 
> say using following,
> 
>         HashMap headerMap = new HashMap();
>         Enumeration e = request.getAttributeNames();
>         while (e.hasMoreElements()) {
>             String field = (String) e.nextElement();
>             headerMap.put(field, request.getAttribute(field));
>         }
> 
> i fill the headerMap. If Authorization header is avialable, *headerMap*
> will contain it.
> 
> So if httpclient contains an API to extract the username and password
> using authorization header that would be really handy.

HttpClient is a for doing HTTP *client* stuff, not server stuff.
Use org.apache.commons.codec.binary.Base64 for easy base64
decoding, the same library httpclient uses for encoding (and
decoding in the NTLM class actually ;p).

-- 
Guillaume Cottenceau
Create your personal SMS or WAP Service - visit mobilefriends.ch

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org


Mime
View raw message