docs.unity3d.com
  • Manual
  • Scripting API
  • Changelog
  • License

    • Identity
      • Installation
    • Get started
    • Best practice | Dependency injection
    • Integrate authentication in your scene
    • Get user information
    • Test with WebGL in a localhost
    • Sample | Integrate Identity in a Unity project

    Test with WebGL in a localhost

    This section describes how to test a localhost WebGL build.

    Identity's authentication engine must call specific cloud Digital Twin endpoints. By default and for security reasons, these endpoints reject any request sent from a localhost environment (this is a CORS issue).

    1. Build your project using the WebGL target.

    2. Start your localhost project on port 55155, which is allowlisted to support this flow. You can use and adapt the following PowerShell script to automate starting your localhost project.

          $monoPath = "C:/Program Files/Unity/Hub/Editor/2021.3.6f1/Editor/Data/MonoBleedingEdge/bin/mono.exe"
          $webServerPath = "C:/Program Files/Unity/Hub/Editor/2021.3.6f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/SimpleWebServer.exe"
          $buildPath = "path_to_my_build_folder"
          $portNumber = 55155
      
          &"$monoPath" "$webServerPath" "$buildPath" $portNumber
      
    3. Test your project locally.

    Back to top Generated by DocFX
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023