473,563 Members | 2,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Authorizat ion" Header not supported in AS3 ?

4 New Member
Hi, I am trying to use AS3 to make a URL request with authorization header. Using the code below:
var request:URLRequ est = new URLRequest ( 'http://myserviceURL' );
var requestHeader:U RLRequestHeader = new URLRequestHeade r("Authorizatio n", "AuthSub token=CI3xlrq1D xCjtruCAw");
request.request Headers.push(re questHeader);
...

But I get the following error:
ArgumentError: Error #2096: The HTTP request header Authorization cannot be set via ActionScript.
at flash.net::URLS tream/load()
at flash.net::URLL oader/load()
...

But according to adobe's api reference, "Authorizat ion" header should be allowed.
Any ideas? Thanks!
Oct 21 '07 #1
5 14099
emahe
1 New Member
Hi, I am trying to use AS3 to make a URL request with authorization header. Using the code below:
var request:URLRequ est = new URLRequest ( 'http://myserviceURL' );
var requestHeader:U RLRequestHeader = new URLRequestHeade r("Authorizatio n", "AuthSub token=CI3xlrq1D xCjtruCAw");
request.request Headers.push(re questHeader);
...

But I get the following error:
ArgumentError: Error #2096: The HTTP request header Authorization cannot be set via ActionScript.
at flash.net::URLS tream/load()
at flash.net::URLL oader/load()
...

But according to adobe's api reference, "Authorizat ion" header should be allowed.
Any ideas? Thanks!
Hi,

I currently encounter the same issue.
I have found that the Authorization header was added to the disallowed HTTP headers list recently (after flash player r47)
Did you find a workaround to make it work?

Thx in advance,

Eric
Jan 2 '08 #2
mfharis
1 New Member
hi all,

I did face the similar issue and i cant set request headers in flash AS3. Actually i m trying to download file from S3 Amazon Bucket, which can only be allowed if custom header is set in a request. I m trying to set that but when I check the request Packets from Etheral or WireShark, the request doesnt contain any of mine custom header.

here is my flash download code;

var headers:Array = new Array();

var authHeader:URLR equestHeader = new URLRequestHeade r("Authorizatio n","AWS: "+accesskey+":" +signature);
var dateHeader:URLR equestHeader = new URLRequestHeade r("x-amz-date",date);

request.url = domainUrl+objec tkey;
request.method = URLRequestMetho d.GET;
headers.push(au thHeader);
headers.push(da teHeader);

request.request Headers = headers;

trace('request: '+request.reque stHeaders.lengt h);

try {
loader.load(req uest);
}catch (error:Error) {
trace("Unable to load requested document.");
}

Remember I uploaded crossdomain.xml in the bucket with polies mentioned as under;

<cross-domain-policy>
<allow-access-from domain="*" secure="false" />
<site-control permitted-cross-domain-policies="all"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>


In order to download file from Amazon Bukcet the Request Packet should be;

GET /<bucketname>/<filename>HTT P/1.1
x-flash-version: 10,0,2,54
User-Agent: Shockwave Flash
Host: s3.amazonaws.co m
Authorization: AWS:<accesskey> :<signature>
x-amz-date: <date>

but after doing all the above work my final request sent to amazon;

GET /<bucketname>/<filename>HTT P/1.1
x-flash-version: 10,0,2,54
User-Agent: Shockwave Flash
Host: s3.amazonaws.co m


:( no custom header here;
plz can anyone suggests
Jan 15 '09 #3
lionsign
2 New Member
mfharis: When I sent,

Expand|Select|Wrap|Line Numbers
  1. var protocol:String = (secure) ? "https" : "http";
  2.             var req:URLRequest = new URLRequest(protocol + "://" + AMAZON_ENDPOINT + resource);
  3. req.method = method;
  4.             var dateString:String = getDateString(new Date());
  5. var dateHeader:URLRequestHeader = new URLRequestHeader("Date", dateString);
  6.             var authHeader:URLRequestHeader = new URLRequestHeader("Authorization", getAuthenticationHeader(method, dateString, resource, contentType, hash));
  7.             req.requestHeaders.push(dateHeader);
  8.             req.requestHeaders.push(authHeader);
  9.  
  10. var req1:URLRequest = getURLRequest("GET", "/" + escape(bucketName));                    
  11.                 stream.load(req); 
  12.  
throws Error #2096: The HTTP request header Date cannot be set via ActionScript.
Please help someone to step forward.
Aug 27 '12 #4
Fary4u
273 Contributor
i've got the same problem have you fix this ?
Sep 27 '12 #5
lionsign
2 New Member
Authorization header is not supported by flash player. Have look of this http://help.adobe.com/en_US/FlashPla...estHeader.html
Sep 27 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
16429
by: mrwoopey | last post by:
Hi, I am using the example "Authenticate against the Active Directory by Using Forms Authentication and Visual Basic .NET": http://support.microsoft.com/default.aspx?scid=KB;EN-US;326340 But I am having a problem figuring out the LDAP:// The LDAP:// that I pass looks like this (i substitued generic the
0
2174
by: Kristofer Liljeblad | last post by:
Hi, I've successfully setup my machine to use: sessionState mode="SQLServer". All is up and running so no problems so far. Because I curious person, I started to play around with the two new tables created on my SQLServer. Here is what I've done. 1. I've created a web projectec consisting of two webforms. The first form (default.aspx)...
2
5346
by: Murphy | last post by:
Our website contains subdirectories for each subsidiary company, each company has it's own look and feel to the pages in their subdirectory although they are all part of the main website. The code below in the Web.Config file defines the authentication as forms and the aspx file required for login if the user is unauthenticated... this...
1
4769
by: Menno Abbink | last post by:
Hey All, I'm developing a new website and I want the customer to be able to se my work in progress so I have set up a server behind my ADSL-router. The server is using W2003. I've created a new website and uploaded some files to test the site. Anonymous access isn't allowed. After I've logged on to the site I see this message:
4
1421
by: samadams_2006 | last post by:
Hello, I have a peculiar problem that I'm hoping someone can help me out with. I have a simple enough Web Application written in VB.Net via Visual Studio 2003. It simply displays a Web Form with a label field saying "Hello". When I run this application interactively via Visual Studio 2003, I have no problems. When I transfer this code...
2
2687
by: Tor Inge Rislaa | last post by:
I am prompted to implement the syntax below to be able to monitor the error on the remote server trough my browser (client). I can't seem to find where to place the code in my web.config file to get this to work. <!-- Web.Config Configuration File --> <configuration> <system.web>
2
7560
by: Ottavio | last post by:
Hello, I'm having some problems with the authentication during a web service call I know I have to add the "Authorization: Basic xxxxxxxx" in the http header (not soap header) but I can't find a way to add it. I've tryed to use ethereal to watch what I'm sending and I can see all the header...
4
9529
by: R.A.M. | last post by:
Hello, I am writing my first ASP.NET application (I use .NET 2.0, Visual Web Developer 2005 Express Edition and SQL Server 2005 Express Edition). The application builds successfully but when I try to start debugging from Visual Web Developer I receive message box: Unable to start debugging on the web server. Debugging failed because...
18
4750
by: =?Utf-8?B?VG9t?= | last post by:
is it possible to add a bunch of users to group and only allow group to access the web page or do I need to add each user to the web.config file? Or is there another way to do this? I just took over a project and most of the web sites have users defined in the web.config file that can access the site. Now users come and go so this config...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7638
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.