Board index » delphi » Indy HTTP Client and Server Demo's

Indy HTTP Client and Server Demo's

I am trying the Client and Server Demo's.  When I give the client demo a
username and password for Authentication, it is never received by the
server.  I have used the client to connect to sites that require
Authentication and it worked great.  But when I connect it to the
IdHTTPServer, I can't find where the username and password are stored.  I
checked the RequestInfo.AuthUsername and AuthPassword, but the username and
password are never passed to this event.  Now, if I connect using the
browser, and pass the username and password in the URL
(http://username:passw...@www.test.com:9099/) it is passed to the
HTTPServerCommandGet just fine.

What am I missing?  Why doesn't the HTTP Server demo get the username and
password from the client demo?

Thanks.

Robert Griffin

 

Re:Indy HTTP Client and Server Demo's


Anybody out there?

Quote
"Robert Griffin" <grif...@nospam-realsol.com> wrote in message

news:3ee0a043$1@newsgroups.borland.com...
Quote
> I am trying the Client and Server Demo's.  When I give the client demo a
> username and password for Authentication, it is never received by the
> server.  I have used the client to connect to sites that require
> Authentication and it worked great.  But when I connect it to the
> IdHTTPServer, I can't find where the username and password are stored.  I
> checked the RequestInfo.AuthUsername and AuthPassword, but the username
and
> password are never passed to this event.  Now, if I connect using the
> browser, and pass the username and password in the URL
> (http://username:passw...@www.test.com:9099/) it is passed to the
> HTTPServerCommandGet just fine.

> What am I missing?  Why doesn't the HTTP Server demo get the username and
> password from the client demo?

> Thanks.

> Robert Griffin

Re:Indy HTTP Client and Server Demo's


Quote
"Robert Griffin" <grif...@nospam-realsol.com> wrote in message

news:3ee0a043$1@newsgroups.borland.com...
| What am I missing?  Why doesn't the HTTP Server demo get the username and
| password from the client demo?
|

i have something like this, and it works good:

var
  LDoc:string;
begin
  if ARequestInfo.AuthUsername='' then begin
    AResponseInfo.AuthRealm := 'My Realm';
    AResponseInfo.ContentText := 'unauthorized';
    exit;
  end;
  AResponseInfo.ContentText:='YES, it works!!!, welcome
'+ARequestInfo.AuthUsername;
end;

Internet explorer always tries without password first even when using the
http://aa:bb@ccc format
when the httpserver then asks for a password, then the internet explorer
asks again, with the password

Bas

Re:Indy HTTP Client and Server Demo's


Quote
"Robert Griffin" <grif...@nospam-realsol.com> wrote in message

news:3ee0a043$1@newsgroups.borland.com...
|
| client demo?
|

oh, damn, i misread your post

you'll have to set TIdHTTP.Request.BasicAuthentication to true

Bas

Re:Indy HTTP Client and Server Demo's


Thanks for all of your responses to my posts.

Quote
> oh, damn, i misread your post

> you'll have to set TIdHTTP.Request.BasicAuthentication to true

> Bas

Where do I set this?

Thanks again.

Robert Griffin

Other Threads