I need to call a function in a WebService from a VC++ 7.1 project. The
WebService requires NTLM authentication and should be the user of the
calling program. How should this be done?
I have found this article from Microsoft:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet
/handling_authentication.asp
But it looks that it's very low-level. Even if I copy the code generated by
the sproxy.exe program and manually change it; then there still are calls to
CSoapWininetClient::SendRequest (defined in atlsoap.h) which indirectly call
HttpSendRequest, mentioned in the article. Does this mean that I have to
change / write all the code in atlsoap.h by myself too?
And even then; in this article is described how to set the username and
password manually by calling InternetSetOption (although it didn't work for
me). But I don't want the user to enter the data again; he is logged in
already in Windows. I just want to send his credentials to the WebService
like Internet Explorer does this too (when the option User Authentication /
Logon / "Automatic logon only in Intranet zone" or "Automatic logon with
current username and password" is set).
How can I do this?
Eric
P.S. Sorry if I'm in the wrong newsgroup; it's a little difficult for this
subject.
Eric - 04 Aug 2005 18:45 GMT
Problem solved for me.
In either way a call to HttpSendRequest is made. That function automatically
makes requests with the correct authentication (Kerberos) if the calling
process is being impersonated correctly.
My problem was that I thought the calling process was impersonated and the
WebService requires NT Integrated Login. That was wrong. The calling process
is always running anonymous (probably Local System or so) and the setting
for the WebService was wrong and should have been Anonymous Login.
Authentication checks are made somewhere else.
Eric
>I need to call a function in a WebService from a VC++ 7.1 project. The
>WebService requires NTLM authentication and should be the user of the
[quoted text clipped - 22 lines]
> P.S. Sorry if I'm in the wrong newsgroup; it's a little difficult for this
> subject.