3 Replies Latest reply on Jul 28, 2006 6:45 PM by ntsiii

    Security error accessing url

    shishir332 Level 1
      I have a HTTPService defined in my application like this.

      <mx:HTTPService
      id="feedRequest"
      url="{UriID.text}"
      useProxy="false"/>

      However when I call the service through click="feedRequest.send()", I get the following error.

      Security error accessing url" faultCode="Channel.Security.Error" .

      Any clues on this. Anyone. Please.

      TIA
      ~Shishir
        • 1. Re: Security error accessing url
          njadobe
          Hi shishir332,

          Are you trying to access a URL on a domain different from the one where your SWF is running? If so, you need to put a cross-domain policy file at the root of the server whose URL you're trying to access. For example, to allow access from any SWF to URLs on that server, you could put create a file "crossdomain.xml" at the root of your server with this content:

          <?xml version="1.0"?>
          <cross-domain-policy>
          <allow-access-from domain="*" />
          </cross-domain-policy>

          The following technote has more information:

          http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_14213

          Thanks,

          nj
          Flex Builder team


          • 2. Re: Security error accessing url
            shishir332 Level 1
            Thanks nj,

            Well the point is that I can access the URLs without any errors when I run the application from the flex builder itself. Also when I run the comiled application from my Document and Settings folder by directly clicking the html wrapper file, I can access the URL. However as soon as I deploy the same on to my application server (OC4J), it starts giving me this painfull error. I would highly appreciate if you clear off my doubts on this philosophy of flex to not allow applications running on server to access other URLs.

            Regards,
            ~Shishir



            Hi shishir332,

            Are you trying to access a URL on a domain different from the one where your SWF is running? If so, you need to put a cross-domain policy file at the root of the server whose URL you're trying to access. For example, to allow access from any SWF to URLs on that server, you could put create a file "crossdomain.xml" at the root of your server with this content:

            <?xml version="1.0"?>
            <cross-domain-policy>
            <allow-access-from domain="*" />
            </cross-domain-policy>

            The following technote has more information:

            http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_14213

            Thanks,

            nj
            Flex Builder team
            • 3. Re: Security error accessing url
              ntsiii Level 3
              "flex to not allow applications running on server to access other URLs"

              It is the Flash Player Security sandbox, not Flex.

              The solution is to have a crossdomain.xml file, if you control the server, or to use a server-side proxy if you don't. Server apps do not have the security limitation that the Flash player does.

              Tracy