Go back to gigya.com

Welcome Guest Search | Active Topics | Members | Log In | Register

Adobe AIR + Gigya problem. Cannot get it working. Options · View
szhurik
Posted: Thursday, July 09, 2009 10:30:28 AM

Rank: Newbie

Joined: 7/9/2009
Posts: 5

Hi All,

I was facing Stage access issue when was trying to load Gigya into an AIR application cause of Flash Player Security policies.

SecurityError: Error #2070: Security sandbox violation: caller http://cdn.gigya.com/wildfire/swf/wildfireInAS3.swf?ModuleID=cfg cannot access Stage owned by app:/dmlSetup.swf.
    at flash.display::Stage/get stageWidth()
    at WildfireInAS3_fla::MainTimeline/WhenAddedToStage()
    at WildfireInAS3_fla::MainTimeline/onEnterFrameHandler()


Then I've changed Loader to URLLoader with binary data format in generated code from Gigya setup:

var urlLoader : URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.addEventListener( Event.COMPLETE, onGigyaLoaded );
urlLoader.load( new URLRequest( 'http://cdn.gigya.com/wildfire/swf/wildfireInAS3.swf?ModuleID=cfg' ) );


Added onGigyaLoaded handler:
private function onGigyaLoaded( e : Event ) : void {
            var loader : Loader = new Loader();
            var context : LoaderContext = new LoaderContext();
            context.allowLoadBytesCodeExecution = true;
            loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onAppExecuted );
            loader.loadBytes( ByteArray( ( e.currentTarget as URLLoader ).data ), context );
}

private function onAppExecuted( e : Event ) : void {
            var uic : UIComponent = new UIComponent();
            wfLoaderBox.addChild(uic);
            uic.addChild( LoaderInfo( e.target ).loader );
}

Stage problem had gone, but another problem did arise.

SecurityError: Error #3207: Application-sandbox content cannot access this feature.
    at flash.system::Security$/allowDomain()
    at WildfireInAS3_fla::MainTimeline/frame1()

Can anyone say something how to get AIR application working with Gigya?



RIA development, Flash/Flex/AIR development
www.exairo.com
eran
Posted: Sunday, July 12, 2009 5:29:48 PM

Rank: Gigya

Joined: 7/29/2007
Posts: 64
Location: Israel

This issue is happening because the SWF in the Air application runs in a different sandbox than Wildfire.

Currently the only way around this is to setup the Air application as a simple HTML file that loads the SWF from the network. In that case both Wildfire and the SWF will be in the network sandbox and will be able to communicate with each other. This method will prevent the SWF from accessing any local resources on the computer.



Eran Kutner
Gigya CTO
szhurik
Posted: Monday, July 13, 2009 9:44:48 AM

Rank: Newbie

Joined: 7/9/2009
Posts: 5

Thanks, Eran.

Are you planning to add support for AIR in the future?



RIA development, Flash/Flex/AIR development
www.exairo.com
eran
Posted: Monday, July 13, 2009 10:03:57 AM

Rank: Gigya

Joined: 7/29/2007
Posts: 64
Location: Israel

So far we haven't seen a lot of demand for that, since it's not very common for someone to want to grab a desktop application and install it in a web destination. Usually the direction is grabbing an application from a web location to the desktop.

If we see demand for this kind of implementations we'll implement better support fo it.



Eran Kutner
Gigya CTO
dbarut
Posted: Thursday, July 30, 2009 12:53:32 PM

Rank: Newbie

Joined: 7/30/2009
Posts: 1
Location: Switzerland
Hello Eran, We also need to have the gigya wildfire support in an adobe air application ! Imagine an desktop air application that let the user add contents, set parameters etc... and then thanks to gigya, directly publish the "web widget" in social network. You will have the power of an dektop application with the power of web distribution ... This functionnality will be a most ! Regards Denis Barut
eran
Posted: Sunday, August 02, 2009 9:10:44 AM

Rank: Gigya

Joined: 7/29/2007
Posts: 64
Location: Israel

Because of the way security sandboxes work in Air there is a problem passing configuration data between an Air application, which is running in the local sandbox, and Wildfire, which is running in the Internet sandbox.

If I understand correctly your goal is to create and configure a widget from an Air application then distribute it using Wildfire - you can still do that. You can open a popup window, pass to it the required widget configuration (as values in the query string) and load Wildfire on that page while passing the configuration you want.



Eran Kutner
Gigya CTO
Kenneth Garee
Posted: Friday, November 06, 2009 11:07:01 PM

Rank: Newbie

Joined: 11/6/2009
Posts: 1
Location: Maui
We are unable to make use of Gigya Wildfire because of the lack of support for Adobe AIR. We hope the Adobe AIR support will come soon as we're interested in the simplicity of Wildfire.
Martin Heidegger
Posted: Thursday, November 12, 2009 11:23:59 PM

Rank: Newbie

Joined: 9/11/2009
Posts: 5

I am sorry but I see no technical reason for a SecurityContext to be necessary at first place: I know that FlashVars can't be used for parameter transfer but its possible. Using GET/POST for it doesn't make any sense as well. But it would be no problem to offer a version which (without violating any security concern) just offers a init method. I put together a small example to illustrate what I mean: The .swf provided by you could look like this:

package 
{
    import flash.text.TextField;
    import flash.display.Sprite;
   
    public class Gigya extends Sprite
    {
        public function init( text: String ): void
        {
            var tF: TextField = new TextField();
            tF.text = text;
            addChild( tF );
        }
    }
}

And to tell your widget that we have information (configuration/embedcodes/whatever) the code at our place could look like this:

 package  
{
    import flash.events.Event;
    import flash.net.URLRequest;
    import flash.display.Loader;
    import flash.display.Sprite;
    
    public class AirTest extends Sprite
    {
        private var _loader: Loader;

        public function AirTest()
        {
            addChild( _loader = new Loader() );
            _loader.load( new URLRequest("http://yourdomain/gigya.swf") );
            addEventListener( Event.ENTER_FRAME, onEnterFrame );
        }

        private function onEnterFrame(event: Event): void
        {
            if( _loader.content )
            {
                _loader.content["init"]( "hi" );
                removeEventListener( Event.ENTER_FRAME, onEnterFrame );
            }
        }
    }
}

This will work perfectly without the need for Security.allowDomain. I know that this solution would violate your current API but this would allow users within AIR to use it as is and will safe a lot of people from a lot of hazzle.

yours
Martin Heidegger

Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.053 seconds.