Given a nsIChannel, you can configure the notificationCallbacks
property to be a nsIInterfaceRequestor that you implement.  In your
GetInterface method, return a nsIAuthPrompt when passed the IID of
nsIAuthPrompt.  Then you will have your nsIAuthPrompt methods called
when the channel would prompt for username and password.

-Darin


On 4/20/06, Kate X <[EMAIL PROTECTED]> wrote:
> Or maybe a better question on this:
> How could I add my customized prompt for authentication and pass the
> credential to httpChannel and let it restart request without create a new
> request? I see firefox popup the prompt to ask username and password and
> then setIdent restart the request.
>
> Thanks in advance.
>
> Kate
>
> "Kate X" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi there,
> >
> > I have problem to create new URI channel with same URI at the same time
> > using necko, it seems one would lock some resource(cache) and the other
> > try to access the same one but failed. But how does firefox do? it works
> > fine when I tried to put more than two same link in one html page.
> > And for the same problem, I want to reopen a new channel when the first
> > request got response code other than 200, for example 401 which need
> > authorization, I need to setRequestHeader and resend the request, but I
> > could not open new channel before the first one has not been released, or
> > if I use the same channel, and call AsyncOpen again with the header
> > setting, I got cache warning and I won't get any more events for my
> > listener.
> >
> > Would anybody give an idea how to solve this?
> > Thanks,
> >
> > Kate
> >
>
>
> _______________________________________________
> dev-tech-network mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-tech-network
>
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network

Reply via email to