views:

58

answers:

1

I have an issue where I am trying to load an external SWF using a SWFLoader, but the HTTP server requires authentication.

<mx:SWFLoader source="assets/externalswf.swf"></mx:SWFLoader>

Is there any way to pass the credentials to the SWFLoader?

A: 

Hi, You can first make an http request to the server to authenticate by setting the authentication headers (e.g. username/password/token etc.) or passing auth info (forms), and if your authentication mechanism uses cookies you can then make the swfloader load the swf file by passing the auth cookies to the server. If your authentication mechanism uses an http parameter similar to a token, you can simply append the token to the swf url (after obtaining the token), e.g. source="assets/external.swf?token=123fea34d8c-45ac34e". Depending on what mechanism the http server uses for authentication, you'll have to tailor it to that.

I've tried both approaches mentioned above with asp.net membership provider to secure xml, swf files and it works great.

RR