Thank you.  This explains a lot.  I had seen posts on how to do this but 
nowhere did I 
stumble on the info you provided.  Specifically, that 9.0.115.0 was a version 
that blocks 
the Authorization header regardless of what you do.  Guess what version I've 
been 
running?  So, I will update to a more recent version and give this a try.

Unfortunately while this will work for some basic auth protected systems I have 
to figure 
out what to do about network devices I'm connecting to that can't have any 
crossdomain 
file added to them.  For those I may just end up setting up a proxy using 
something like 
mod_proxy.

I will post the results after I try this out.

-Bill


--- In [email protected], "nathanpdaniel" <[EMAIL PROTECTED]> wrote:
>
> Add the request headers (as in the code), where userService is an 
> HTTPService, baseUrl is the page you need to be authorized to use, 
> and auth is the username:password (I'm assuming - I got this example 
> from here:
> http://geekzguru.wordpress.com/2008/07/04/howto-add-basic-
> authentication-header-to-httpservice/
> 
> Also check the Adobe TechNote here:
> http://kb.adobe.com/selfservice/viewContent.do?
> externalId=kb403184&sliceId=2
> 
> 
> <mx:Script>
>     <![CDATA[
>         import mx.utils.Base64Encoder;
>         import mx.controls.Alert;
> 
>         private var baseUrl:String 
> = "http://phprestsql.sourceforge.net/tutorial/user";;
>         private var auth:String = "p126371rw:demo";
> 
>         private function init():void{
>             var encoder : Base64Encoder = new Base64Encoder();
>             encoder.encode(auth);
>             userService.headers["Authorization"] = "Basic " + 
> encoder.toString();
>             deleteUser();
>         }
>     ]]>
> </mx:Script>
> 
> 
> Please not - I googled for this and found everything above - I've 
> never tried it - so I have no clue if it actually works... :D
> 
> 
> 
> --- In [email protected], "wdsnapper" <wdsnapper@> wrote:
> >
> > Anyone out there understand how to get Flex working with a simple 
> Basic Auth protected 
> > REST API?  If not is there a fundamental reason why this does not 
> work in Flex?  It seems 
> > like such a core basic (no pun intended) piece of functionality for 
> a Flex app to hook up to 
> > an existing XML based service to provide a new view.
> > 
> > 
> > --- In [email protected], "wdsnapper" <wdsnapper@> wrote:
> > >
> > > I'm trying to access a basic auth protected site from Flex and 
> not having any success.  I 
> > see 
> > > that you can no longer add the "Authorization" header as you 
> could over a year ago.
> > > 
> > > The setCredentials and setRemoteCredentials methods in the 
> HTTPService class seem 
> > like 
> > > they should do the trick but I've had no luck with them.
> > > 
> > > Does someone out there have a pointer to a functional example 
> showing how to use 
> > Basic 
> > > Auth from Flex?  I've seen a lot of posts in this forum but have 
> been unable to find a 
> > solution.
> > > 
> > > Thanks in advance.
> > >
> >
>



Reply via email to