Re: SOAP Security: HTTP-Basic authentication

Martin Honnen <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization Liberty Development
Message-ID <[email protected]>

Eugene Prokopiev wrote:

>> Pop up dialog is suitable for me.
> 
> 
> sorry, it's _not_ suitable for me

I am not sure the SOAP API has any way to provide username and password 
for basic authentication but for me here with Firefox 1.0 it works to 
use XMLHttpRequest first to make a HTTP HEAD request sending the 
credentials (the open method has the fourth and fifth argument for that) 
and then to make the SOAP call e.g.


var soapCall = new SOAPCall();
soapCall.transportURI = 'http://example.org/services/service.asmx';
soapCall.encode(...);

var httpRequest = new XMLHttpRequest();
httpRequest.open('GET', soapCall.transportURI, false, 'username', 
'password');
httpRequest.send(null);

if (httpRequest.status == 200) {
   var soapResponse = soapCall.invoke();
   ...
}


That way the basic HTTP authentication happens and for the browser 
session Mozilla remembers that so that the SOAP calls then work.


-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.