Infrastructure Map Server Forum
Welcome to Autodesk’s Infrastructure Map Server Forums. Share your knowledge, ask questions, and explore popular Infrastructure Map Server topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cross Domain API Calls

1 REPLY 1
Reply
Message 1 of 2
CurtisHa
484 Views, 1 Reply

Cross Domain API Calls

We have a Web Server (Server 1) that embeds the url of the MapGuide Server (Server 2). When calling the ZoomToCentiod function for the MapGuide Object. What is the best way for a page running on Server 1 to make any Mapguide API calls (i.e. ZoomToCentroid) on Server 2?
1 REPLY 1
Message 2 of 2
sakkaku
in reply to: CurtisHa

There is no "easy" way to do this. By default talking between domains is disabled in javascript. This is good because say a site opened an iframe to your website, browsed through the dom to find the password field and saved your password (and no that wont be a bunch of symbols like you see in the browser). I would highly recommend to having the viewer and your site on the same server.

You might be able to get around it by doing a cross site scripting (xss) attack on yourself. Make a script that takes in raw javascript and adds it to the document. Then when you need to execute the API you will need to redirect to that page. You need to preserve window.opener though and at this point I am unsure if this will work (I am pretty sure domain limitations would hit for attempting to use a script frame for the same purpose). All in all it isn't something that you would want to be doing.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report