1 Reply Latest reply on Nov 15, 2010 3:11 PM by Bram BBA

    HTTPService and Basic Authentication


      I was using the following approach to do https basic authentication with HTTPService


      private function addAuthHeader(service:HTTPService):void



        var username:String =  model.someLogin

        var password:String =  model.somePassword


        //add the header to request

        var enc:Base64Encoder = new Base64Encoder();

        enc.encode(username + ":" + password);

        service.headers["Authorization"] = "Basic " + enc.toString();



      This worked fine in Flex 4.0 SDK and never caused a system popup to appear. But now in Flex 4.1 I'm getting a second, system dialog box popping up asking for the credentials again.


      Furthermore, I seem to be getting errors in other GET and POST requests where I had none in Flex 4.0


      Does anybody know exactly what changed in the SDK from Flex 4.0 to 4.1 that might have this kind of impact?

      Thanks for any thoughts.


        • 1. Re: HTTPService and Basic Authentication
          Bram BBA

          Any news on this?


          I have exactly the same problem.


          I really don't understand that basic authentication for a webservice isn't supported in flex.


          I need to do basic authentication to get access on the wsdl.


          I tried already with/without blazeds.


          I tried to set the headers with this:

          service.headers["Authorization"] = "Basic " + enc.toString();


          and also with setCredentials, setRemoteCredentials.


          In the flex code I see the headers been set, but when I look on the http requests with wireshark no headers are set.