SDK for Unity (PC, web) / Access has been blocked by CORS policy
  Back to Docs

SDK for Unity (PC, web)

Access has been blocked by CORS policy

Issue description

The issue appears in browser-based (WebGL) builds of the application. When user sign up, log in or other request to Xsolla Login is performed, the following error message is displayed:

Copy
Full screen
Small screen
    Access to XMLHttpRequest at '{request}' from origin '{your domain}' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the request resource.
    

    Fix

    Add the URLs that are allowed to call the API methods from the browser. To do it:

    1. Open your project in Publisher Account.
    2. In the side menu, click Login.
    3. Click Configure in the pane of a Login project.
    4. Select the Callback URLs section.
    5. In the Allowed origins (CORS) field, add the URLs that will be allowed to call the API methods from the browser.
    6. Click Save changes.

    Was this article helpful?
    Thank you!
    Is there anything we can improve? Message
    We’re sorry to hear that
    Please explain why this article wasn’t helpful to you. Message
    Thank you for your feedback!
    We’ll review your message and use it to help us improve your experience.
    Last updated: April 9, 2024

    Found a typo or other text error? Select the text and press Ctrl+Enter.

    Report a problem
    We always review our content. Your feedback helps us improve it.
    Provide an email so we can follow up
    Thank you for your feedback!