[ka-Map-users] Calling ka-map backend from a remote website throws security exception

Christian Sengstock csengstock at gmail.com
Thu Sep 21 11:52:01 EDT 2006


Hi,
i don't have any problems with iexplorer should have said that! And of
course it's a security implementation thing loading from a remote url
via javascript. I'm off-topic sorry ;)

Anyway a short description how i think it could be done:

I tried using the "netscape.security.PrivilegeManager" method to get
permission to do it. I
modified the XMLHttpRequest.open call in xhr.js to check for the
netscape/mozilla privilege handler:

## xhr.js - line 106 ##
if(typeof netscape != 'undefined' &&
   typeof netscape.security != 'undefined' &&
   typeof netscape.security.PrivilegeManager != 'undefined')
{
   netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
   aXmlHttp[idx][0].open(method,u,true);
}
else
{
   aXmlHttp[idx][0].open(method,u,true);
}

after that i got an error that permission is not granted because the
script is not signed (exception in javascript console - no dialog
box)!

If i can manage to sign these ka-map javascripts on my server i think
mozilla would ask if remote url calling should be allowed. And
hopefully it's working then ;)

Using a proxy script sounds like a nice ajax pattern. Will have a look ...

Thanx,
Chris



2006/9/21, Paul Spencer <pspencer at dmsolutions.ca>:
> Christian,
>
> you need to create a script that will proxy your request to your
> remote server.  This is a fairly common problem.  I believe there are
> a number of proxy scripts available.
>
> Alternately, you could load the application from that server ...
>
> Cheers
>
> Paul
>
> On 21-Sep-06, at 8:30 AM, Christian Sengstock wrote:
>
> > Hi all,
> > i want to call ka-map from a server which is *not* the ka-map backend
> > apache server (a tomcat servlet engine). What i did:
> >
> > 1) In my tomcat html page i referenced to the javascript files on the
> > ka-map backend with full url.
> > 2) I changed line 176 in kaMap.js (this.server =
> > http://my-ka-map-backend) to point on my ka-map backend.
> >
> > I got an security exception because of an XMLHttpRequest calling a
> > remote url (with firefox)
> >
> > "Error: uncaught exception: Permission to call method
> > XMLHttpRequest.open was denied"
> > Orig: "Fehler: uncaught exception: Die Erlaubnis für den Aufruf der
> > Methode XMLHttpRequest.open wurde verweigert"
> >
> > Anyone knows a solution or workaround for this? Like it's working with
> > google maps!?
> >
> > Thanx a lot,
> > Chris
> >
> > _______________________________________________
> > ka-Map-users mailing list
> > ka-Map-users at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/ka-map-users
>
> +-----------------------------------------------------------------+
> |Paul Spencer                           pspencer at dmsolutions.ca   |
> +-----------------------------------------------------------------+
> |Chief Technology Officer                                         |
> |DM Solutions Group Inc                 http://www.dmsolutions.ca/|
> +-----------------------------------------------------------------+
>
>
>
>
>



More information about the ka-Map-users mailing list