[Gllug] Http Auth
Branden Faulls
bfaulls at omphe.com
Tue Nov 18 12:59:23 UTC 2003
Luke Hopkins wrote:
how do I post
> past htaccess? Putting the user/pass on the url isn't an option here
> (http://user:pass@www.domain.com/script.php), are there some field names
> I can use (eg http://www.domain.com/script.php?user=username&pass=pass)?
> Are there 'default' field names for htaccess under apache?
You will need to send the users credentials in the headers of your
request to the server. The format of the header is as follows:
Authorization: Basic [base64 encoding of "username:password"]
Be sure to separate the username and password with a semicolon
Undoubtedly there will be 2 beeellion ways to do this in PERL.In PHP it
would look like:
$username = 'foo';
$password = 'bar';
header('Authorization: Basic ' . base64_encode($username . ":" .
$password));
Have a look at the HTTP spec at:
http://www.w3.org/Protocols/HTTP/1.0/spec.html#BasicAA
Good Luck,
Branden Faulls
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list