Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-13876

[Flash Player] URLRequestDefaults and some new properties of URLRequest are listed in the Flex 3 Docs but not available in Flex 3 beta 3 SDK

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • Adobe Flex SDK 3.0 (Release)
    • Web Compilers
    • None
    • Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:
      1. Create a Flex Project using the Flex 3 beta 3 SDK
      2. Create a URLRequest instance, and try to access the authentication property.
      3. Try to use the URLRequestDefaults.setLoginCredentialsForHost() method.

      Actual Results:

      Neither the authentication property of URLRequest nor the entire URLRequestDefaults class come up in code completion.

      If you try to import flash.net.URLRequestDefaults or compile the above app, it will throw errors at compile time, not recognizing the new class or properties as valid.

      If you use the AIR compiler, they are available (but obviously won't run on FlashPlayer)

      Expected Results:

      We need to be able to do basic http authentication for Web apps. The Flex 3 documentation indicates that URLRequestDefaults "lets you define default authentication credentials for requests" and that URLRequest.authenticate:

      " Specifies whether authentication requests should be handled (true or not (false) for this request. If false, authentication challenges return an HTTP error.

      The supported authentication methods are:

      • Windows—HTTP Basic/Digest, Windows Integrated Authentication (including NTLM and Kerberos), SSL Certificate Authentication.
      • Mac—HTTP Basic/Digest, NTLM, SSL Certificate Authentication.

      Note:The FileReference.upload(), FileReference.download(), and HTMLLoader.load() methods do not support the URLRequest.authenticate property.

      The default value is true."

      The documentation makes no distinction between FlashPlayer and AIR, and we hope that there will not be one in the final implementation.

      Workaround (if any):

      Currently there is no way we have figured out to do basic authentication in a useful way. Before it was restricted in a recent release of FlashPlayer, we were modifying the headers like this:

      public function basicAuthentication(username:String,password:String):void

      { var encoder:Base64Encoder = new Base64Encoder(); encoder.encode(username + ":" + password); var value:String = encoder.drain(); //trace('Base64 value:' + value); this.addHeader("Authorization","Basic " + value); }

      This no longer works.

      The only thing we have worked out to do basic http authentication so far is to concatenate username:password@url, but aside from being lame, this is no longer supported on IE, therefore it is not a viable solution.

      Further more, without the ability to prevent a 401 response from bubbling (is this the right term?) up to the browser, there is no way to handle invalid credentials. The browser takes over and presents the user with a basic authentication dialog. If the user cancels that, there is no elegant way to determine what to do, essentially leaving the app in a fictional logged-in state.

      We are desperately hoping for a supported way to do basic http authentication. If this is not it, please tell us what is.

      You can look at our issue demostrator app here http://shn.serveftp.net/flexfm/FMBasicAuth.html
      If you log in with something other than the suggested valid credentials you will experience the basic auth prompt from the browser. Will not work at all on IE.

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: