Re: TIdHTTP proxy authentication

Giganews Newsgroups
Subject: Re: TIdHTTP proxy authentication
Posted by:  Ben Taylor [Team Indy] (to_b…@yahoo.com)
Date: Fri, 16 Sep 2005

You will need a recent (less than a couple of months old) dev build for
ntlm auth (sspi) to work (seehttp://indy.fulgan.com/ZIP/)

Use the following code, IN THIS ORDER.
The OnProxyAuthorization handler has to be present, but is left empty.

uses
  IdAuthenticationSSPI,
  ...

begin
  //setup the http object
  h:=TIdHTTP.Create;
  h.HTTPOptions:=h.HTTPOptions+[hoInProcessAuth];
  h.ProxyParams.ProxyServer:=aServer;
  h.ProxyParams.ProxyPort:=aPort;
  h.ProxyParams.ProxyUsername:=aUser;
  h.ProxyParams.ProxyPassword:=aPass;
  h.ProxyParams.Authentication:=TIdSSPINTLMAuthentication.Create;
  h.OnProxyAuthorization:=Self.CallbackAuth;
  //get the webpage, cleanup etc
  ..
end;

procedure TmyObject.CallbackAuth(
  Sender: TObject;
  Authentication: TIdAuthentication;
  var Handled: Boolean);
begin
end;

Márta Csaba wrote:
> Hi ALL,
>
> I have problem with TIdHTTP proxy authentication. I wrote some letters to
> news groups but I haven't got any answers.
>
> I use D7 Enterprise and Indy 10. The TIdHTTP works only with the Basic
> auhtentication, but the Digest, NTLM fails. I use squid proxy server.
>
> source code:
> HTTP.ProxyParams.ProxyServer  := PServerName;
> HTTP.ProxyParams.ProxyPort    := 3128;
> HTTP.ProxyParams.ProxyUsername:= PUser;
> HTTP.ProxyParams.ProxyPassword:= PPsswd;
>
> What sould I do to work the authentication correctly?
> Can I use Kerberos protocoll with TIdHTTP during proxy authentication
> (win2003 ISA proxy)?
>
> Best Regards
> Csaba Márta

Replies

None

In response to

TIdHTTP proxy authentication posted by Márta Csaba on Thu, 15 Sep 2005