Copy link to clipboard
Copied
I'm writing a flash (flex actionscript) application that connects to a webservice using mx.rpc.soap.WebService over https and using Basic Authentication. I understand that flash will remove the authentication headers if there is no crossdomain.xml file on the server root. In development mode when I run my flash application the browser still pops up the authentication request. When I enter it the app runs fine. But when I create a release and run it using the browser I don't get the browser popup and authentication fails and my application cannot continue. Does anyone know how to fix this?
My code is below
var ws:WebService;
var encoder:Base64Encoder = new Base64Encoder();
encoder.insertNewLines=false;
encoder.encode(event.credentials.username + ':' + event.credentials.password);
var encodedCredentials:String = new String();
encodedCredentials = encoder.toString();
ws = new WebService();
ws.addEventListener(FaultEvent.FAULT, onFault);
ws.addEventListener(ResultEvent.RESULT, onResult);
ws.httpHeaders = {Authorization:"Basic " + encodedCredentials};
ws.loadWSDL(event.credentials.url + "?wsdl");
Copy link to clipboard
Copied
I also noticed that when I release to bin-release under the project folder. I get the popup window. But if I release to a different folder outside of the project then I don't get the popup and authentication fails. I've gone through the deployment documentation but can't think of what I might be missing.