Re: sending authorized POST requests

Christian Stocker <[email protected]> 01 Nov 2002 21:31:19 +0100
Newsgroups gmane.editors.bitflux.devel
Message-ID <[email protected]>
Hi holger

I quickly checked the bugs on mozilla and didn't found anything which
relates to that:

http://bugzilla.mozilla.org/show_bug.cgi?id=176051 is about something
different with http authentication and XmlHttpRequest. Other solutions I
didn't found in this short time. I'll check with heikki from netscape,
maybe he knows more.

chregu


On Fri, 2002-11-01 at 20:47, holger krekel wrote:
> Hello,
> 
> In the transport driver 'http.js' i want the save
> function to work with authenticated HTTP.  I know
> that the server sends back a '401 Unauthorized' after
> (basically) these lines of code:
> 
>         this.p.open("POST",filename,true );
>         var xmlstring = BX_getResultXML();
>         calc = calculateMarkup(xmlstring, true);
>         this.p.setRequestHeader('Content-Type', 'text/html');
>         this.p.send(xmlstring, true);
> 
> Now the browser/javascript is supposed to resent the 
> request with the correct 'Authorization' header.
> Other GET and POST requests (not initiated from javascript)
> work fine (before and after the failing one).
> 
> The server does sent the 401 Unauthorized completly ok.
> If i *manually* set the Authorization header with 
> 
>     this.p.setRequestHeader('Authorization', 'Basic ...')
> 
> all works fine.  This is obviously not a proper solution.
> 
> 1) How could i enforce that 'resending' works?
> 
> 2) how could i - from javascript - access the Authentication
>    information?  I guess for 'security' reasons i can't :-(
> 
> 3) what other solution? 
> 
> thanks for any help (even for pointing me to a site which
> likely has this information). 
> 
> regards,
> 
>     holger
> -- 
> bx-editor-dev mailing list
> [email protected]
> http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-dev


-- 
bx-editor-dev mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-dev