tags:

views:

30

answers:

1

I have a flex app running on my server.

I have had a request from some clients to have the swf loaded on their server, so that their customers dont have to be transferred to my server to login; i.e. from the user's point of view it looks like they are logging in from theirsite.com instead of mysite.com

I tried something really simple, and that was to give them a html wrapper to host on their site. The only modification that I made was to change the "src" var to:

"src", "https://www.mysite.com/app/myapp.swf" and embed src="https://www.mysite.com/app/myapp.swf"

To my surprise, this worked perfectly. And best of all, the service calls still seem to come from mysite.com, so I dont have to bother with modifying the crossdomain.xml file.

All good it seems.

Are there any issues or downsides to the above that I should be aware of?

+2  A: 

If you're doing an ExternalInterface calls to JavaScript in the enclosing page, this may cause a security error; since the SWF from your domain shouldn't be able to access HTML content served from your client's domain.

I expect that is a fringe case though. Aside from that, what you're doing is not much different than what YouTube does. I've done the same thing with The Flex Show player. I don't think you'll have any issues. And I do not believe that this approach makes your app any less (or less) secure.

www.Flextras.com
The one issue that I havent got my head around yet, is that I update the swf on a regular basis. To make sure that this gets pushed to clients, I change the swf name (appending the version number), and udpate the html wrapper on my site to reflect this. I'm not quite sure how to automate this for clients though - other than me asking them to change their html wrapper each time.
JonoB
Do you update your SWF so often that browser caching is a serious issue? With an HTML page, you can do some metadata to force a refresh; but with a SWF I Do not believe that is an option. Instead of having the user request a SWF, you could send them to a script. You can use the script to deliver the most up to date version; just specify the return mimtype and return the binary swf data. [I do this on www.TheFlexShow.com with sponsorship images].
www.Flextras.com
Yup, I am updating the swf quite often - sometimes more than often than once per week. The caching was a bit of a headache, but we do force refresh with meta data (although google chrome is still a bit crap with this).If you are willing to share, I'd love to see your script that you mention above.
JonoB
A simplified version is this: <cfcontent type="image/jpeg" file="myImage.jpg"> . I see no reason you can't do <cfcontent type="application/x-shockwave-flash" file="mySWF.SWF"> . I assume other languages have similar ways of implementing the same thing.
www.Flextras.com