Hello, all:
My background: I'm a reasonably well-versed C++ programmer, and have a
little COM knowledge, but not much. (Eg, I know what an interface is,
and what to do with QueryInterface(), AddRef(), and Release().)
I've been poking around in netwerk/protocol/http/src recently,
evaluating the difficulty of implementing an nsIHttpAuthenticator to
handle NTLM authentication. (stupid MS proxies. ::rolls eyes::)
I'm confused about how it actually gets called, though. The only method
defined by nsIHttpAuthenticator is GenerateCredentials(), called each
time the client recieves a WWW-Authenticate: HTTP header. (The basic
HTTP authentication, and the file that I'm looking at as an example, is
netwerk/protocol/http/src/nsHttpBasicAuth.cpp) If I create a class, say
nsHttpNTLMAuth, implement the one necessary function, and call
NS_INIT_ISUPPORTS(); from the constructor, how exactly does the stream
handler "know" which one to call? I've been digging for 2 hours, and
can't find anything that iterates through the different implementations
of nsIHttpAuthenticator ... though i don't even know if COM provides a
mechanism to *do* that. The nsCOMPtr to an nsIHttpAuthenticator is
actually created on line 1345 of nsHttpChannel.cpp, reproduced below:
nsCOMPtr<nsIHttpAuthenticator> serv = do_GetService(contractid, &rv);
Which implementation of nsIHttpAuthenticator is returned? This is at
the limits of my (limited!) COM knowledge ... any input would be *most*
appreciated. (Including, but certainly not limited, a bonk on the head
and a pointer (no pun intended!) to a more appropriate newsgroup.)
Thank you all!
Brian
--
Brian Teague
Baker '04
Rice University
Give up on misery
Turn your back on dissent
Leave their distrust behind
Wash your hands of regret
--