I have encountered only one problem: it seems that the property
TWebRequest.Authorization does not work with Apache (always it gives empty
string), so I cannot use basic authentication, while with Isapi it works.
Any idea ?
I use Delphi 6 (no update pack) + Apache 1.3.19; this is my code:
...
Authorized := FALSE;
DecodeUserNameAndPassword(Request.Authorization, Userid, Password);
if (Userid = '') and (Password = '') then exit;
Authorized := TRUE;
...
{ Added by Shiv }
procedure DecodeUserNameAndPassword(EncodedString : string;
var UserName, Password : string);
var
DecodedString : string;
begin
{ EnocodedString will look like this:Basic c2hpdjptYXRsdXM= }
{ Remove the word Basic }
EncodedString := Copy(EncodedString, 7, Length(EncodedString));
{ Use only the text upto the "=" sign }
EncodedString := Copy(EncodedString,1, Pos('=',EncodedString) -1);
{ Decode the text }
DecodedString := MimeDecodeString(EncodedString);
{ Extract the UserName and Password }
UserName := Copy(DecodedString,1,Pos(':', DecodedString) -1);
Delete(DecodedString,1,Pos(':', DecodedString));
Password := DecodedString;
end;
Fabrizio Vita
When I try to call my dll via my browser, I get a message telling me I am
downloading the file, and asking if I want to open or save to disk. Of
course, I don't want to download. I want to execute!
When I change the settings, then I get a page of garbled characters that
says at the top "This program must run under windows".
QUESTION -- Please send me a snip from your httpd.conf file that permits you
to run dlls
under Apache.
I am a complete beginner with Apache.
Thanks!
- John Howard
Santa Rosa, CA
"Fabrizio Vita" <fabriz...@logontec.it> wrote in message
news:3bdf0025_2@dnews...
>Hi everybody,
>I have ported my Isapi applications to Apache DSO technology and I'm quite
>happy of it: performance seems better and I can debug with Apache easily,
>while debugging with IIS it's a nightmare.
>
>I have encountered only one problem: it seems that the property
>TWebRequest.Authorization does not work with Apache (always it gives empty
>string), so I cannot use basic authentication, while with Isapi it works.
>Any idea ?
>
>
This may help - the Authentication code does not seem to be
implemented in the apache unit but this code will get the string you
are after
This is a code sample that retrieves the Authorization string
Result := false;
//now see if exists
s := Request.GetFieldByName('Authorization'); <--- this is it
//if exists, parse it
if Length(s) > 0 then
begin
if AnsiCompareText(LeftOf(' ',s) , 'Basic') = 0 then
---> now decode from base 64 etc
Andrew McIntyre
Thanks,
- John
"John Howard" <joho...@home.com> wrote in message news:3be30f59_2@dnews...