httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <do...@osf.org>
Subject Re: perl subroutine for ascii -> HTTP auth header ?
Date Wed, 12 Jun 1996 21:40:43 GMT
On Wed, 12 Jun 1996, Rob Hartill wrote:

> 
> anyone have a perl subroutine to convert a username & password
> into a HTTP header line for authorization?
> 
> I remember writing one some time ago (lots of base64 nonsense) but
> I've lost it.
> 
> Anyone have this?

If you have the libwww-perl5 package:

use MIME::Base64;

my($uid,$pwd) = ("Apache", "BestServerEver");
my $auth_header = 
   "Authorization: Basic " . encode_base64("$uid:$pwd");

If you need to send a Digest header, see LWP::UserAgent, it's my one and
only hack to the great package...

Just another perl lover,

-Doug

> 
> 
> cheers,
> rob




Mime
View raw message