authentication on NTLM Proxy

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
directcallAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CayceCommented:
Can you elaborate your question?

Thanks
0
directcallAuthor Commented:
Well,

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.

Thanks
0
CayceCommented:
This article explains how to do it using the TNMHTTP component: http://www.delphi3000.com/articles/article_1434.asp?SK=

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));
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.