I am trying to access instagrams API w开发者_JS百科ith FLash, I keep getting a "Security sandbox violation: cannot load data from https://api.instagram.com/v1/media/popular?client_id=...etc" but it works in the IDE. It is loading the cross domain policy file from https://api.instagram.com/crossdomain.xml and I have security allow api.instagram.com in the swf. Any thoughts? Am I stuck using a backend proxy?
Make sure you're using :
Security.loadPolicyFile("https://api.instagram.com/crossdomain.xml");
Possibly try swapping out the https with http? Probably not the right solution.
Otherwise, yes, try the proxy back-end solution.
I've encounered the same problem while trying to access Instagram API from as3 application located on the remote server. I've tried something like http://my-secret-domain.com/app and got the exception.
The solution was to access my app through https, exactly like the app accesses the Instagram API. The only thing I didnt get is why the Flash Player cares about https for request that is made after the app was loaded to local mashine using http.
Closely follow the guidelines for registering your client and authorization process available on developer authentication page. It covers everything necessary to access the API. If you are building native AIR app implicit authentication will be good choice, choose explicit server side auth for alternative development strategy.
精彩评论