0

I have three servers:

Server A: Main Application host

Server B: Host for another application which opens up in Main application as an openScoial Gadget

Server C: Host for the OpenSocial specification file for the application on server B

Now, I access application on server A, but I get error saying access denied from some javaScript files function.

Seems like some cross domain issue, any help is welcomed.

absar'
  • 11
  • 3

1 Answers1

0

Are you using any kind of authentication with your gadget? Why is the xml on a different server to the application? Are they also on different domains? What methods are you using to load javascript? Which OpenSocial Container implementation are you using? Are you using locked domains? What have you tried so far?

I can give you some general advice / information, but without answering at least the above questions, I can't understand exactly what your problem is.

OpenSocial gadgets are rendered inside iframes and their domain is chosen by the OpenSocial container rendering them, they are almost never (no cases that I know of) rendered on the domain of the gadget xml. Often this domain will simply be the domain of the parent page / OpenSocial container, unless locked domains is enabled, in which case the gadget will render on a separate, unique domain to prevent it accessing anything from the parent page.

Cross domain policy blocks xhr requests, this is why you need to use gadgets.io.makeRequest for anything you would normally do with xhr, but makeRequest requires some kind of authentication (usually oauth), because this basically involves the OpenSocial container proxying content from the gadget's server (server's C and B in your example). It will still be possible to load javascript / data using JSONP which is not affected by the cross origin policy.

Frances McMullin
  • 5,516
  • 2
  • 18
  • 19
  • Thanx for the answer David, can you share some link that how can I access a web-page(Following cross domain policy) through an iFrame in a simple html page.? – absar' Feb 25 '13 at 11:45
  • All I need is to bypass cross domain policy.! – absar' Feb 25 '13 at 11:45
  • you haven't answered any of the questions I asked. Have you tried searching for "bypass cross domain policy"? (you really shouldn't do that...). To render an iframe in a simple html page, simple include – Frances McMullin Feb 25 '13 at 12:00