Discussion:
Winnt library when used in service fails on NTLM.
(too old to reply)
v***@gmail.com
2007-04-10 13:34:53 UTC
Permalink
hi,
I am using a ISA Proxyserver which uses NTLM. My client program
uses wininet library. and its working as an application. but when its
run as a service, i can see NTLM packets are going without Hostname
and domain and its failing on HttpSendRequest with Timed out. When i
use LogonUser and ImpersonateLogedonuser, Its working even in service.
But i cannot take a username and password to run LogonUser. Is there
any good idea to do this ?
How can i impersonate to loged on user without taking username and
password of current system? If i go for WinHTTP will it work ? Thank
you.
Johannes Passing
2007-04-10 19:24:13 UTC
Permalink
Fyi, it is discouraged to use wininet in services:
http://support.microsoft.com/kb/238425/en-us

Does your service run as SYSTEM? Have you tried running the service
using a custom user account?

Johannes
Post by v***@gmail.com
hi,
I am using a ISA Proxyserver which uses NTLM. My client program
uses wininet library. and its working as an application. but when its
run as a service, i can see NTLM packets are going without Hostname
and domain and its failing on HttpSendRequest with Timed out. When i
use LogonUser and ImpersonateLogedonuser, Its working even in service.
But i cannot take a username and password to run LogonUser. Is there
any good idea to do this ?
How can i impersonate to loged on user without taking username and
password of current system? If i go for WinHTTP will it work ? Thank
you.
--
Johannes Passing - http://int3.de/
v***@gmail.com
2007-04-11 04:38:04 UTC
Permalink
Yes its running from system account. I moved the code to WinHTTP
now.and im calling
WinHttpSetCredentials(http,WINHTTP_AUTH_TARGET_PROXY,WINHTTP_AUTH_SCHEME_NTLM,pUser,
pPasswd,0);
before using WinHttpSendRequest. But now it gives LOGIN_FAILURE (when
connects to an ISA Proxyserver).
The same works when i again call LogonUser and
ImpersonateLoggedOnUser.
Thank you.

Loading...