4 Replies Latest reply on Jun 16, 2009 6:44 AM by Damon Edwards

    AuthorizationHeader keeps failing

    Damon Edwards Level 3

      I'm attempting to send some data to the youtube api which requires setting the Authorization.  Well, I keep getting the same error no matter what I try:


      ArgumentError: Error #2096: The HTTP request header GoogleLogin auth=AIwbFATSaHE2FlARRDegkMZkQDg1h_XqmHHkpPXiPCqs5oZmmp2XQL2kW1uIGQ8gWOUmXjV5V5m8kHdrKf_c XzA4dwDGnrRntLp8SBLqrSiXFYMvjnaYVZOB5BfKdRUUFMRkmhkuKKWozNyLhl6xwCDL_Rog9p-jcg
      cannot be set via ActionScript.


      This is how I'm setting the header:


      var header1:URLRequestHeader = new URLRequestHeader("Authorization", "GoogleLogin auth="+yt.session_token);


      YouTube's gdata api does have the proper crossdomain.xml file in place which states the following:


      <?xml version="1.0"?>
      <!-- http://gdata.youtube.com/crossdomain.xml -->
      <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
      <allow-access-from domain="*"/>
      <allow-http-request-headers-from domain="*" headers="*"/>


      When I test my aplication I get the following warning reguarding the crossdomain policy:


      Warning: Domain gdata.youtube.com does not explicitly specify a meta-policy, but Content-Type of policy file http://gdata.youtube.com/crossdomain.xml is 'text/x-cross-domain-policy'.  Applying meta-policy 'by-content-type'.


      So, what can I do to solve this problem?  After a week of googling, the only thing I came up with is that AIR applications don't have a restriction for headers (which obviously is wrong), or to use some 3rd party http service (which I'm not going to do).


      Thanks for any help, it's very much appreciated