Walt Welton-Lair
2004-10-04 15:51:47 UTC
I have a simple ActiveX control which uses WinInet to access content via
HTTP. It uses the standard call sequence:
InternetOpen -> InternetOpenUrl -> InternetReadFile
and uses InternetErrorDlg to automatically prompt for user credentials, when
needed.
Now consider the following scenario:
- I use my browser (IE) to access a secure site
- IE prompts me for my credentials, and I log in normally
- I then navigate to a web page on that site which embeds my ActiveX control
- the control uses WinInet, as described above, to access content on that
site
So my question is: will I ever be required to re-enter my credentials?
(Assume that had I made the same request using the parent browser then I
would NOT have been asked to re-authenticate.) Part of me says yes, because
the control is opening its own new connection via InternetOpen. Another
part of me says no, because it's opening the connection in the context of
the browser which is already authenticated.
I did try this using a web service that uses basic authentication, and
didn't have to re-renter my credentials. That's good, but I'm not yet
convinced it will work in all situations. I'm new to WinInet and don't yet
know what it's doing under the covers. I was told that once I'm
authenticated for a particular site then any new connections made to that
site using WinInet will not require re-authentication as long as they're
made as part of the same process. If that's true then it seems I'm ok in my
situation, since the ActiveX control runs in the same process as the parent
browser. Can anyone confirm this? Is the behavior documented anywhere?
Thanks in advance.
Walt
HTTP. It uses the standard call sequence:
InternetOpen -> InternetOpenUrl -> InternetReadFile
and uses InternetErrorDlg to automatically prompt for user credentials, when
needed.
Now consider the following scenario:
- I use my browser (IE) to access a secure site
- IE prompts me for my credentials, and I log in normally
- I then navigate to a web page on that site which embeds my ActiveX control
- the control uses WinInet, as described above, to access content on that
site
So my question is: will I ever be required to re-enter my credentials?
(Assume that had I made the same request using the parent browser then I
would NOT have been asked to re-authenticate.) Part of me says yes, because
the control is opening its own new connection via InternetOpen. Another
part of me says no, because it's opening the connection in the context of
the browser which is already authenticated.
I did try this using a web service that uses basic authentication, and
didn't have to re-renter my credentials. That's good, but I'm not yet
convinced it will work in all situations. I'm new to WinInet and don't yet
know what it's doing under the covers. I was told that once I'm
authenticated for a particular site then any new connections made to that
site using WinInet will not require re-authentication as long as they're
made as part of the same process. If that's true then it seems I'm ok in my
situation, since the ActiveX control runs in the same process as the parent
browser. Can anyone confirm this? Is the behavior documented anywhere?
Thanks in advance.
Walt