Hi, ever since they changed FlashPlayer so we can't modify http
headers directly, we've been searching for a way to do basic http
authentication that will work in IE. We were doing this before they
changed it, but now it doesn't work:

public function
basicAuthentication(username:String,password:String):void {
  var encoder:Base64Encoder = new Base64Encoder();
  encoder.encode(username + ":" + password);
  var value:String = encoder.drain();
  this.addHeader("Authorization","Basic " + value);
}

The old (lame) trick of putting username:[EMAIL PROTECTED] works okay on
Safari and FF, but we still don't have a way to use URLRequest on
hosts that require basic authentication since this technique will make
the browser show the basic authentication dialog if the credentials
are not authorized. This is really lame. We need a way to trap and
suppress the 401 response.

I see URLRequestDefaults() in Flex 3, but it seems to be an AIR only
class.
http://livedocs.adobe.com/labs/flex3/langref/flash/net/URLRequestDefaults.html

We can get it to compile using the AIR libraries, but that won't do
for what we are trying to accomplish, which needs to work in FlashPlayer.

Can anyone guess if URLRequestDefaults() is likely to become available
in the FlashPlayer API? It's in flash.net so it doesn't seem like it
should be missing. There are also some new properties for URLRequest()
that we'd like to be able to use, such as authenticate (which I think
will suppress the 401 response from bubbling up to the browser), but
it isn't available in Flex 3 for FlashPlayer either (yet?)
http://livedocs.adobe.com/labs/flex3/langref/flash/net/URLRequest.html

The only clue I see that there is a difference is that there is a
little icon next to the menu entry for URLRequestDefaults here
http://livedocs.adobe.com/labs/flex3/langref/ 

It seems so unlikely that Adobe will fail to provide a way to do basic
http authentication from FlashPlayer, but stranger things have
happened, I suppose.

Reply via email to