Adobe Flash Player 901150 Onwards Allows Setting Authorization Http Header


--- layout: post status: publish published: true title: Adobe Flash Player 9.0.115.0 onwards allows setting Authorization HTTP header author: display_name: Abdul Qabiz login: admin email: [email protected] url: http://www.abdulqabiz.com author_login: admin author_email: [email protected] author_url: http://www.abdulqabiz.com wordpress_id: 422 wordpress_url: http://www.abdulqabiz.com/wordpress/?p=422 date: ‘2009-01-06 15:50:00 +0530’ date_gmt: ‘2009-01-06 10:20:00 +0530’ categories: - Actionscript tags: - Adobe - flash - flashplayer - http - authorization - header - as3httpclient comments: - id: 2017 author: Platfuse author_email: [email protected] author_url: http://www.platfuse.com date: ‘2009-01-27 13:35:49 +0530’ date_gmt: ‘2009-01-27 08:05:49 +0530’ content: “For Flash Player 9.0.115+ when sending HTTP headers â\x80\x9Ccrossdomainâ\x80\x9D as you know a crossdomain.xml with allow-http-request-headers-from set appropriately.\n

If the crossdomain.xml file is protected by Basic Authentication, you keep getting the Basic Authorization popup. Expose crossdomain.xml and make it unsecured. Example a folder ‘above’ the secured folder - i.e. http://anyDomain.com/secured/myservices
\nand your crossdomain should be at http://anyDomain.com/crossdomain.xml, which would load the crossdomain from the root of the ‘service’ web server)

\n

About SENDING basic authentication
\n------------------------------------

\n

\nimport mx.utils.Base64Decoder;
\nimport mx.utils.Base64Encoder;
\nimport mx.rpc.events.ResultEvent;
\nimport mx.controls.Alert;
\nimport flash.system.;
\n
\nimport flash.events.
;
\nimport flash.net.URLLoader;
\nimport flash.net.URLRequest;
\nimport flash.net.URLRequestHeader;
\nimport flash.net.URLRequestMethod;
\nimport flash.net.URLVariables;

\n

/* pass authorization header with urlRequest */
\npublic function doURLRequest():void {
\nvar loader:URLLoader = new URLLoader();
\nconfigureListeners(loader);
\n// the username and password for authentication
\nvar creds:String=\“admin:password\”;
\n
\nvar request:URLRequest = new URLRequest(\“http://anyDomain.com/secure/blank.html\”);
\nrequest.data = new URLVariables(\“name=Plat+Fuse\”);
\nrequest.method = URLRequestMethod.GET;
\n
\nvar header:URLRequestHeader;
\n
\nvar encoder:Base64Encoder = new Base64Encoder();
\nencoder.encode(creds);
\nvar encodedCreds:String=encoder.toString();

\n

header = new URLRequestHeader(\“Authorization\”, \“Basic \” + encodedCreds);
\nrequest.requestHeaders.push(header);
\nheader = new URLRequestHeader(\“Content-Type\”, \“application/x-www-form-urlencoded\”);
\nrequest.requestHeaders.push(header);
\ntry {
\nloader.load(request);
\n} catch (error:Error) {
\ntrace(\“Unable to load requested document.\”);
\n}
\n}

\n

private function configureListeners(dispatcher:IEventDispatcher):void {
\ndispatcher.addEventListener(Event.COMPLETE, completeHandler);
\ndispatcher.addEventListener(Event.OPEN, openHandler);
\ndispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
\ndispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
\ndispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
\ndispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
\n}

\n

private function completeHandler(event:Event):void {
\nvar loader:URLLoader = URLLoader(event.target);
\nAlert.show(\“completeHandler: \” + loader.data);
\n}

\n

private function openHandler(event:Event):void {
\ntrace(\“openHandler: \” + event.toString());
\n}

\n

private function progressHandler(event:ProgressEvent):void {
\ntrace(\“progressHandler loaded:\” + event.bytesLoaded + \” total: \” + event.bytesTotal);
\n}

\n

private function securityErrorHandler(event:SecurityErrorEvent):void {
\nAlert.show(\“securityErrorHandler: \” + event.toString());
\n}

\n

private function httpStatusHandler(event:HTTPStatusEvent):void {
\ntrace(\“httpStatusHandler: \” + event.toString());
\n}

\n

private function ioErrorHandler(event:IOErrorEvent):void {
\nAlert.show(\“ioErrorHandler: \” + event.toString());
\n}
\n//
\n]]>
\n
\n
\n

\n/*
\nThe key is you need to\n

set request.data or the headers will not get sent:
\n# request.data = new URLVariables(â\x80\x9Dname=Plat+Fuseâ\x80\x9D);

\n

Make the request a POST, not a GET
\n# request.method = URLRequestMethod.POST;\

\n*/

\n” - id: 2018 author: Abdul Qabiz author_email: [email protected] author_url: http://abdulqabiz.com/blog/ date: ‘2009-03-07 02:01:53 +0530’ date_gmt: ‘2009-03-06 20:31:53 +0530’ content: | \@Platfuse Thanks for update, just curious is it solution or a problem here? Never mind, I am not top on Flash world these days. Thanks -abdul - id: 2019 author: Christian Boese author_email: [email protected] author_url: ‘’ date: ‘2009-03-17 19:22:34 +0530’ date_gmt: ‘2009-03-17 13:52:34 +0530’ content: ‘Do I understand it right: There still ist no way to send an HTTP-Basic Authorization Header with a GET Request? I tried a lot of things and still (even with the new player) couldn’‘t get it to work withthe standard URLRequest. With HTTPURLRequest (thanks again for the code!) it works (given a good crossdomain-file served on port 843). ‘ - id: 2020 author: Abdul Qabiz author_email: [email protected] author_url: http://abdulqabiz.com/blog/ date: ‘2009-03-17 19:28:24 +0530’ date_gmt: ‘2009-03-17 13:58:24 +0530’ content: | \@Christian AFAIK, yeah there is no way to send HTTP AUTH headers over GET request. Great to hear, code still works. Thanks for using it. You can check out the latest at: http://code.google.com/p/as3httpclient Thanks -abdul - id: 2021 author: Danny author_email: [email protected] author_url: ‘’ date: ‘2009-03-25 07:55:14 +0530’ date_gmt: ‘2009-03-25 02:25:14 +0530’ content: | I’ve been struggling with this issue. Objective is to interact with the google calendar api which requires a name/password login, then getting a key from the response and using it as the auth token in the Authorization header of subsequent requests. As you say, the flash players from 9.0.115 and beyond now allow the setting of the authorization header however, the GET requests can’t have the auth header so it has to be a POST with request data. If it doesn’t have request data, then it gets converted from a POST to a GET and say bye to the auth header. Adding request data, however, messes up the use of the Google Calendar API as far as I can tell, which expects zero content. I’ve pinged Matt Chotin and he responded that the browsers implementing the flash plugin take some responsibility for the problems so its not something Adobe can readily fix. Still, does that mean Flex can’t interface with all the great network api’s out there? Your socket approach holds promise to get around the problem, but it would be a big project to take on to do it right and my vote would be on Adobe taking it on unless they can pressure the browswer guys. I guess it would be a “brute force” approach to getting http auth instead of using higher level apis of the browswer products. So as it is, I can use AIR just fine, which uses hooks to windows (in my case) to send the http auth, but no hope on the horizon for flex apps. I’ll give your socket code a try to achieve this, but not sure the long term potential or maintainability. thanks for your work, Danny - id: 2022 author: Abdul Qabiz author_email: [email protected] author_url: http://abdulqabiz.com/blog/ date: ‘2009-03-25 08:44:22 +0530’ date_gmt: ‘2009-03-25 03:14:22 +0530’ content: | \@Danny You are right, doing HTTP Auth over HTTP/GET is not possible with Flash Player as of now. I just figured out, some folks found my class useful. http://www.scoop.uk.com/index.php/general/scoop-beta-033/2008/12/ You might want to ask them, how they used it. If they modified the code, would they want to share it with you? Thanks -abdul - id: 2023 author: Danny author_email: [email protected] author_url: ‘’ date: ‘2009-03-31 19:34:05 +0530’ date_gmt: ‘2009-03-31 14:04:05 +0530’ content: | Hi Abdul, I’ve been trying out your socket based httpclient. It works well but for the application I’m working on, it faces a problem with google responding with a 302 not found/redirect before the cookie/sessionkey is available. In this case a normal http client redirects “under the covers” but I’ve found your client doesn’t automagically handle redirects. I’ve also seen the defect list where it is highlighted. Before I write a 302 handler, could you tell me if you’ve addressed or are planning to address this feature? I imagine there are numerous other low level conditions that need handling, and the wish list could be long, although my application is limited to interfacing with some google apis and possibly amazon s3 apis. Are there other “abnormal” response codes that folks have flagged with your client? I saw your input to the blog input to Scoop (users of your framework). I don’t think they should have a problem with original auth using https. In my app, I do first login with https using the normal flex/air httpservice, then use your client for subsequent calls which require setting the auth header returned from the original httpservice based login. I’m not sure exactly the app their using but I think using your framework in concert with the flex one can get around many problems. thanks again, Danny - id: 2024 author: Billigflüge author_email: [email protected] author_url: http://www.charterticket.de date: ‘2009-04-17 13:57:31 +0530’ date_gmt: ‘2009-04-17 08:27:31 +0530’ content: | Hello, thank you for this great work. It helped me solving some authorization problems I had with my site. - id: 2025 author: april author_email: [email protected] author_url: ‘’ date: ‘2009-05-12 07:41:48 +0530’ date_gmt: ‘2009-05-12 02:11:48 +0530’ content: | Can I use the same method connect to https server? why I always get IO error? Thanks! April - id: 7364 author: mcpd tests author_email: [email protected] author_url: http://www.mcpdtests.com/ date: ‘2010-03-10 17:49:00 +0530’ date_gmt: ‘2010-03-10 12:19:00 +0530’ content: hello julia here..Ensure that you have the latest version of Flash Player installed by clicking here to check the version. The current version of Flash Player 9 for Windows, Macintosh, and Linux operating systems is 9.0.115.0. The current version of Flash Player 9 for Solaris operating systems is 9.0.47.0. ---

There were some issues with some earlier version of players, where it was not possible to set Authorization http-header for HTTP/GET requests. I tried to hack a way to do it using Socket or custom http-client in actionscript.

I just happened to read one of the technotes at Adobe’s site, which says Authorization header is allowed for Flash Player 9.0.115.0 onwards. If you are trying to send request to another domain (different from the one hosting the SWF), a crossdomain-policy file is required.

Live Documents - AIR app

After a long time, I checked out Live Documents’ website and found they have released an Adobe Integrated Runtime (AIR) application called “Live Presentation”.

I couldn’t resist to check it out and hence started looking at it. I am impressed, it has neat user-interface though there is a room of improvement. Overall, Live Presentations is nicely done.

live-documents.jpg

Technorati tags: live+presentations, air, office+suite, offline

Mobile AIR - When is it coming out?

I have been playing with a lot of mobile widget-platforms. Some of these are Yahoo! Mobile Widget (Yahoo! Go) and S60 WRT.

Both of these are good, but I like S60 WRT when it comes to building widgets for S60 (Symbian) platform. If I have to build widgets for different mobile devices (running on different platforms), Yahoo! Mobile Widget (Blueprint) is good option.

I have to learn new things, which is good, but I was wondering - why can’t I use my existing skills (ActionScript + JS/HTML/CSS) to build things for mobile devices without learning new workflow and technology?

When are we going to see Adobe Integrated Runtime for mobile devices - Mobile AIR? Life would be lot easier, I could transform a lot of my ideas easily into applications?

Hope it happens soon, really soon.

Technorati tags: mobile, widget, platform, yahoo go, s60, wrt, adobe

Slowdown or recession - how do you take it?

I am not an expert when it comes to economics and finance, trying to learn things with each passing day. I have been watching and reading news, listening to people who are good at the subject.

After having known the slowdown/recession details, I spent good amount of time thinking, reading the causes and effects. Not sure, if I should have gone into all those details.

I realize, more I read worse it gets, I get concerned, upset and distracted after reading layoffs, dead(dying)-startups and future.

Ignorance is bliss, I guess that fits here, unaware of these details I was far more focused on what I do.

I am going to stop focusing on this whole slowdown/recession thing and just focus on how I can do things better than ever? How can I help my customers by providing better solution to their problems?

I am going to focus on building a team which is technically great, innovative, focused and very motivated.

Future means how well we do today i.e. foundations for tomorrow. If we do things better today, tomorrow is going to be alright. By just reading and spending time discussing, I am not going to achieve much - I would rather spend that time improving processes, practices and culture in my office.

BTW! Our company is doing well and we have good amount of work, perhaps it’s because not many from our team know about what’s going on, hence they are focused.

I am optimistic.

Technorati tags: recession, slowdown, economics, optimism, finance

Flash Player 10 (64bit edition)

Adobe has made available a 64-bit Adobe Flash Player 10 (pre-release) on labs.adobe.com. I believe, it would work on GNU/Linux and Solaris.

Would it work on FreeBSD also? If yes, then a lot of my FreeBSD friends (in Yahoo and elsewhere) would be happy :-)

Flex Compiler Modules

In one of my projects, I was trying to use Flex Compiler Module for Apache. I was doing development on my Mac OSX and everything worked fine. As soon as, I uploaded application on server (CentOS 4.5, x86_64), it didn’t work.

After some debugging, I figured out Flex Compiler Module binaries are compiled as 32bit would not work on 64bit version of Apache. I could have used some third-party wrappers or rebuild it again for 64bit, unfortunately Adobe has not provided source-code for these modules.

There was another problem, it seems this apache-module has dependency on glibc, the required version of glibc is not available for RedHat/CentOS 4.5. Now that’s weird, even if I had source code, not sure I could build against 64bit of CentOS? Not even sure about CentOS 4.5 x86?

BTW! glibc seems to be an important library and one can not just go ahead and update for one requirement, it might actually break many other applications. Hence, I didn’t upgrade glibc on CentOS 4.5 to the required version.

So as an alternative, I used Flex Compiler API by writing some wrappers in Java and then invoke API using PHP. But it seems there is weird licensing i.e. I need to have license of Adobe LCDs in order to use Flex Compiler API?

I have fallen back on pure PHP implementation, I need to figure out about custom logging.

Flex Learning Paths @ Adobe DevNet

Flex Learning Paths, a new initiative by Adobe Developer Connection.

What is Flex Learning Paths? As it’s name suggests, it’s basically a way to point someone, new to Flex, to a relevant/right direct direction (design, development, architecture or management related).

I guess, it’s one of the best moves in the history of Adobe/Macromedia Developer Network. It would really take away a lot of confusion and information overloading and cluttered user-interface.

The best thing, there is section for managers, wow that’s time saver - now developers can just point their managers to that link :-)
Nicely categorized information can really save a lot of time and makes us very focused. I bet, you are going to like it too.

Flex Learning Paths

Flex Learning Paths Application (Beta)

I wish, Flex Learning Path can pick up information from some community driven wiki. Information on Flexcoders FAQ and CFlex are is great. I am sure, community can contribute a lot, of course wiki would require some moderation but again community leaders can be given that responsibility too.

That way, information on Adobe Flex Learning Path would be more useful and managers/decision-makers would take it more seriously when they see how other companies (community showcase) are using the technology and saying (company/start-up blog posts).

Technorati Tags: flex, learning, path, adobe, devnet

OpenFiler - an opensource NAS

We wanted to have a scalable storage system. So I went ahead and checked out the cost of buying [NAS] from various vendors (NetApp, Dell, etc). I figured out, it was going out our of budget. Then I started learning, what it takes to build a [NAS] for a small teams like ours.

I started evaluating various [FOSS] [NAS] options for our office. I checked out FreeNAS and OpenFiler, finally decided on OpenFiler.
I chose OpenFiler for simple reasons - stability and production-quality. Whereas, FreeNAS has a lot more features, than OpenFiler, but doesn’t look that stable. Perhaps, in future I might go for FreeNAS for it’s various cool features (UPNP, iTunes streaming, etc).

We are using an old server based on Intel’s Server Entry Board, Pentium 4 processor, one Gigabyte memory, one IDE drive and two SATA drives. Both SATA drives are under RAID 1 configuration using OpenFiler’s software RAID. I am planning to get RAID controller card so we can use more disks.
OpenFiler boots from [USB] flash-drive, to make this happen it took some extra effort, Thanks to h@nnes. FreeNAS provides images for flash-devices, so it’s lot easier to boot FreeNAS from USB flash-device. BTW! Booting OpenFiler or FreeNAS from USB flash-drive would save one IDE/SATA port on motherboard, which can be used to plug-in another harddrive for better purpose (not for booting small NAS OS).

Anyway, we are using Intel NAS Performance Toolkit to benchmark our NAS server. We are also doing a lot of tests (semi)manually. The idea is to cover all cases and also come up with disaster recovery strategy.
I would post more details on our findings/benchmark-tests, so it helps you, if you plan to go for it.

Technorati tags: openfiler, NAS, freenas

Apple Service - my experience

My macbook has started having problems now, after 29 months. It had some problems around an year back but I got it fixed at a local reseller more on personal terms than professional (via Apple Support).

Apple has great products but any great product without good service is of no use. Specially, now I am in a city where I would not find any Apple reseller or service-provider. I don’t want to travel to New Delhi or even Lucknow, there is no certainty that things would be done in time or would be done at all. I am not sure, if local service-providers are trained enough to do quality service?

Apple needs it’s own centers.

Anyway, it seems Apple is yet to grow in India. Perhaps, they would, since their products are quite competitive with other brands in India.
BTW! My macbook might qualify for battery-extension program, but Apple tech support and customer relationship deny that. They say, your macbook is too old (29 months) and battery should be replaced, oh that means I am going to pay at least 4-5 K (INR)?

BTW! I am quite impressed to see HP’s support in Kanpur, if not India. They are amazing, we have got some 4-5 HP notebooks and it’s really impressive to see how HP has been good to us. They don’t even keep our notebooks, if hardware procurement is required and it might take days, they would rather call us as soon as hardware is available and replace things on spot. That’s nice thing, they really understand how important a notebook is to it’s owner.

I was avoiding to write about Apple Service, but I couldn’t resist specially after being denied to the support I am supposed to get, even when I explained them how hard it is to get service done here.

Support Creative Commons - Donate

If you ever liked and appreciated how Creative Commons has made this world a better place by bringing all the good things (creativity, freedom, collaboration, etc) - Then why not support it in this crunching times?

Please donate to Creative Commons.

Technorati tags: creative, commons