Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

Question Has been blocked by CORS policy

Discussion in 'WebGL' started by NetworkingServices, Sep 4, 2022.

  1. NetworkingServices

    NetworkingServices

    Joined:
    Mar 28, 2022
    Posts:
    20
    Hello, I'm getting this error when building/running my webgl game.

    The code I'm using is:
    upload_2022-9-4_5-42-27.png

    upload_2022-9-4_5-41-7.png

    Any ideas? Thanks
     
  2. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    277
    KeyAuth doesn't seem to support client Javascript. You should ask KeyAuth once.
     
  3. NetworkingServices

    NetworkingServices

    Joined:
    Mar 28, 2022
    Posts:
    20

    I'm co-owner for it... just needed to get origin header. Now I can make requests easily.
     
  4. diegoop

    diegoop

    Joined:
    May 7, 2014
    Posts:
    8
    I'm not familiar with KeyAuth, but as far as I understand, CORS will prevent any call to a service hosted in any domain other than the one where the app is running.

    What about setting up a middle web service in the same domain you are hosting your app so you can call it from Unity and handle from there the request to KeyAuth in the server side?