authentication on NTLM Proxy

Posted on 2004-11-10
Last Modified: 2013-11-17
How to authenticate on NTLM proxy server from my application.
I have no idea how to do this, I have found a broken link here about this subject, anyone can help me ?
I need to know how NTLM proxy works
what components or objects C++ builder 6 have to dealing with this.
A good example is apreciated and links to this subject too.

best regards
Question by:directcall
    LVL 9

    Expert Comment

    Can you elaborate your question?


    Author Comment


    I trying to access a web page from my bcb6 application, but I have had dificult with NTLM proxy-authentication because I dont Know how it works. I need a component that do this authentication for me, I know indy components but I think it do only basic authentication or not ? Links to this subject and code examples are apreciated too.

    LVL 9

    Accepted Solution

    This article explains how to do it using the TNMHTTP component:

    It's on delphi, but changing it to pascal should be not hard at all.

    As a matter of fact here's it:

    AnsiString __fastcall EncodeAuth(AnsiString username, AnsiString password)
      TNMUUProcessor *uu;
      TStringStream *si, *so;
      AnsiString decoded;
      AnsiString encoded;
      AnsiString result;

      decoded = username+":"+password; // Username:Password
      encoded.SetLength(20 * decoded.Length()); // Estimate len

      uu = new TNMUUProcessor(Application); // UU Processor
      si = new TStringStream(decoded); // Input
      so = new TStringStream(encoded); // Output

      uu->InputStream = si;
      uu->OutputStream = so;
      uu->Method = uuMime;
      uu->Encode(); // Decode

      result = so->ReadString(255); // Read Result
      result = result.SubString(1, result.Pos("\n") - 1); // No CRLF

      delete si;
      delete so;
      delete uu;

      return result;

    void __fastcall TForm1::NMHTTP1AboutToSend(TObject *Sender)
      String username;
      String password;
      // username and password should be defined somewhere else
      NMHTTP1->SendHeader->Insert(2, "Proxy-authorization: " + EncodeAuth(username, password));

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
    Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now