1 Reply Latest reply on May 19, 2012 5:51 AM by Purushotham Nayak

    webservice with authentication, browser popup missing after release/deployment

    Purushotham Nayak

      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");