Enable withCredentials in krpano.js to load cross-origin xml file.

  • Hi!

    I have a setup where the main html (generated in web app) is in one domain and the krpano.js, xml file and images etc are in another subdomain, behind cloudfront and a private bucket in S3.
    To access the resources the web app generates a signed cookie to grant access to cloudfront. And I understand the images can be loaded for cors with credentials.
    However krpano.js fails to load the xml file because the request does not have apparently set withCredentials to true, so no cookies are sent.
    Is there a way to enable the use of credentials for all krpano ajax requests, not only images?

    To overcome that, at the moment I am generating a static html file in S3 and opening it within an iframe, but then there is the problem that within the iframe in another domain cannot access the gyro for webvr mode. I followed the instructions here to forward gyro events to the iframe, but it does not seem to be received within the iframe, or I don't know how to handle it correctly. I tried to send a "fake" motion event within the iframe but it is not caught up.

    So at the moment I am redirecting accesses from ios/android devices to cloudfront, without an iframe, but that solution is not ideal because the cookies expire and the user won't be able to access from the redirected url in the future (bookmarks, sharing link etc brokes).

    I would appreciate pointers on how to solve those issues.
    Thank you for your time!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!