RE: passwords can't be retrieved using auth?
Axel Amthor (axel.amthor@interprise.de)
Fri, 18 Sep 1998 16:15:45 +0200
Hi,
get yourself a copy of RFC 2068. As described there (several sections)
things are very easy. Once you got the "Authenticate: Credentials" header
through whatever you want, take "credentials" and decode the string with
base64decode (The string is base64 encoded 'cause passwords may contain
tokens or 8-bit char's)
What you get is a string like userid:password (or vice versa, just look in
that RFC).
Be aware of the fact that password may contain any character, ':', '\n' as
well as
none-printables!
For that base64 decoding, use a Library:
#!/usr/bin/perl
# base64.pl -- A perl package to handle MIME-style BASE64 encoding
# A. P. Barrett <barrett@ee.und.ac.za>, October 1993
# $Revision: 1.2 $$Date: 1993/11/01 12:12:29 $
(may be outdated, try to find out the latest Version)
hope that help's
cu
Axel Amthor Interprise Network Computing GmbH
Witneystr. 1, 82008 Unterhaching
mailto:axel.amthor@interprise.de
http://www.interprise.de
Fone: +49 (0) 89 / 61 55 95 - 30
Fax: +49 (0) 89 / 61 55 95 - 29
> -----Original Message-----
> From: libwww-perl-request@ics.uci.edu
> [mailto:libwww-perl-request@ics.uci.edu]On Behalf Of Peter F. Brown
> Sent: Donnerstag, 17. September 1998 08:44
> To: libwww-perl@ics.uci.edu
> Subject: passwords can't be retrieved using auth?
>
>
> Dear Folks,
>
> I've gotten two responses (thank you!) about the question of retrieving
> the username / password pair after the user has gone through the .htaccess
> authorization process. (Using a Perl script to pull the header info from
> the browser's transmission, and using the libwww auth functions.) I want
> to retrieve the password in decoded format, so I can pass it to other
> scripts.
>
> Unfortunately, neither response clarified how it could be done using
> libwww. Somehow I thought the header.pm or auth.pm libraries offered this
> functionality. Is it true that it's not possible? If it is possible, does
> anyone know how to do it?
>
> Thanks!
>
> Yours,
>
> Peter
>
> ..........................................................................
> http://futurerealm.com - FutureRealm Productions - home of:
> "The HeartThread Resource Page on Marriage, Parenting, Family & Society"
>
http://musicviews.com - MusicViews by Kim Korman Brown
http://worldcommunity.com - WCN - The World Community Network
Web Site Hosting, Web Design, CGI Programming and SQL Databases
http://wtne-sales.com - Washington Times National Weekly Edition
National Sales Office Web Site - Get YOUR 4 FREE Issues Here!