Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Wininet through NTLM proxy authentication

519 views
Skip to first unread message

Thierry...@yahoo.com

unread,
Oct 26, 1999, 3:00:00 AM10/26/99
to
Hi

I am trying to write a Win32 app that would connect and fetch
information from a Web site. I wanted to be able to do that from a
Windows 95 workstation, authenticated on a NT domain. I access
the Web through a MS proxy server, configured to demand NTLM
authentication. I use the following sequence :

InternetOpen (using INTERNET_OPEN_TYPE_PRECONFIG)
InternetConnect
HttpOpenRequest
HttpSendRequest
InternetReadFile
HttpEndRequest

It works fine in a non proxied environement, but, when I try to use it
through the proxy, from a NT-domain autenticated account,I keep having
the following message :

407 Proxy Authentication Required
You must authenticate with a proxy server before this request can be
serviced. Please log on to your proxy server, and then try again.

while I have absolutely no problem with IE.
Does anybody has an idea ? I have already tried to repeat the
HttpSendRequest/InternetReadFile part, to swallow the first answer from
the proxy.

Sent via Deja.com http://www.deja.com/
Before you buy.

Vittal

unread,
Nov 1, 1999, 3:00:00 AM11/1/99
to
Follow up question:

I too got a similar error but had a workaround by passing the proxy userid
and password
check out
http://msdn.microsoft.com/workshop/networking/wininet/overview/authenticatio
n.asp
for a solution to this.


I have a follow up question.
Does INTERNET_OPEN_TYPE_PRECONFIG retrieve proxy userid and password
automatically.
I guess it does not since i got a 407 error. Does IE store that in the
registry . If so where.
My requirement is:
if the user already logs on to the website and provides authentication
userid/password.,
can i use that information stored somewhere in the registry to reconnect to
the Internet using wininet.
(basically i dont want another dialog to come up asking for user to enter
the userid/password again)

Thanks
Vittal

<Thierry...@yahoo.com> wrote in message
news:7v59ae$o8d$1...@nnrp1.deja.com...

Jeff

unread,
Nov 6, 1999, 3:00:00 AM11/6/99
to
I have also been trying to figure out how to handle NTLM (NT
Challenge/Response) proxy authentication from within my apps. I would be
interested in any information you find out.

-- Thanks, Jeff
jbra...@iname.com

Thierry...@yahoo.com

unread,
Nov 7, 1999, 3:00:00 AM11/7/99
to
In article <OBFN5mIK$GA.226@cppssbbsa05>, "Jeff" <jbra...@iname.com>
wrote:

> I have also been trying to figure out how to handle NTLM (NT
> Challenge/Response) proxy authentication from within my apps. I
> would be interested in any information you find out.
>
> <Thierry...@yahoo.com> wrote in message
> news:7v59ae$o8d$1...@nnrp1.deja.com...
> > Hi
> > I am trying to write a Win32 app that would connect and fetch
> > information from a Web site. I wanted to be able to do that from a
> > Windows 95 workstation, authenticated on a NT domain. I access
> > the Web through a MS proxy server, configured to demand NTLM
> > authentication. I use the following sequence :
> >
> > InternetOpen (using INTERNET_OPEN_TYPE_PRECONFIG)
> > InternetConnect
> > HttpOpenRequest
> > HttpSendRequest
> > InternetReadFile
> > HttpEndRequest
> >
> > It works fine in a non proxied environement, but, when I try to use
> > it through the proxy, from a NT-domain autenticated account,I keep
> > having the following message :
> >
> > 407 Proxy Authentication Required
> > You must authenticate with a proxy server before this request can be
> > serviced. Please log on to your proxy server, and then try again.
> >
> > while I have absolutely no problem with IE.
> > Does anybody has an idea ? I have already tried to repeat the
> > HttpSendRequest/InternetReadFile part, to swallow the first answer
> > from the proxy.

Ok folks, the magic answer is to add the INTERNET_FLAG_KEEP_CONNECTION
flag in the HttpOpenRequest call. for example :

hHandleOpenRequest = HttpOpenRequest( hHandleConnect , NULL ,
pszObject, NULL , NULL, NULL,
INTERNET_FLAG_KEEP_CONNECTION ,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ulContext );

And that's all. WININET will automagically handle the connection with a
NTLM authentication at the proxy. I found that by sniffing a legit IE
HTTP session in a proxied environnement. So it means that once the user
is authenticated on the domain, any app can open a HTTP (or FTP)
connection without user intervention.

Kalpna Patel

unread,
Nov 14, 1999, 3:00:00 AM11/14/99
to
Thierry,

How did u sniff the ie HTTP session?

I've installed the debug wininet.dll (File Version: 5.00.2919.3800) from the
Oct 99 MSDN Platform SDK.
But it crashes IE 5.0 (File Version 5.00.2014.200).

tia,
Kalpna

0 new messages