Re:TIdHTTP and Proxy (NTLM)
Tomasz,
Quote
> From your post I assume that the only thing I need to do is to
include
> ...SSPI.pas to my project and leave the ProxyParams.UserName empty.
I'm not sure, I haven't used Indy myself, but someone from Indy team
should be able to help you, probably Doychin. You must specify somehow
TIdSSPINTLMAuthentication as your proxy authentication class and you
have to set proxy authentication username parameter blank for your
code to hit SetCredentialsAsCurrentUser call.
Quote
> I have tried that so far. It didn't work.
> 1) When tracing the execution of Indy Source code beggining from
HTTP.Get
> call to the point where I get the error message I found out that it
never
> executes method SendCredentialsAsCurrentUser(). Am I right that
something is
> wrong ?
Yes, you are correct.
Quote
> 2) You said that user should be logged into windows NT domain. What
about
> computers that are not members of windows NT domain ?
I've said it before, but I have to clarify it <g>:
Quote
> > Microsoft NTLM implementation supports two operation modes:
> > 1) Authenticate using "Current User" security context;
> > 2) Authenticate using "MSDomainName\UserName\Password" triple.
The way option 1) works is like this:
- user MY_USERNAME logins to a domain MY_DOMAIN using her/his
MY_WORKSTATION that is part of the domain;
- after successfull login (password is correct and all the rest)
windows running on MY_WORKSTATION creates "security context" (just a
bunch of bytes and strings) that identify all programs run by the user
at the screen as executed by MY_USERNAME from MY_DOMAIN, so they
(programs) can PROVE to anyone else that there is a MY_USERNAME from
MY_DOMAIN behind them without bothering the actual person with any
questions for passwords and so on;
- when MY_USERNAME user runs a browser on MY_WORKSTATION that connects
to MY_SERVER running MS http proxy, the browser sends the "security
context" via NTLM protocol to the proxy program on the other side of
the wire and the proxy should be able to VERIFY the "security context"
as being belong to MY_USERNAME from MY_DOMAIN. For that MY_SERVER has
to have access to domain controlers for MY_DOMAIN, which in simplest
situation would be to make MY_SERVER a memeber of the domain within
the same network.
For option 2), it's all the same except that you don't have required
"security context", you have a diffirent one. But you can create
temporary required "security context" if you know MSDomainName,
UserName and Password, and then proceed as before.
As I said before, the current Indy code is structured in such way that
it is impossible to execute option 2), but it can be changed assuming
Indy team would be willing to design and document a way of passing
"MSDomainName\UserName\Password" triple to the proxy authentication
class.
I hope, I didn't make it even more complicated <g>.
Alex