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

    Get started

    This getting started guide outlines the basics of setting up a project with Identity.

    Install the package

    To install Identity on a new or existing Unity project, install the Identity package using the installation instructions.

    Register an app in the Digital Twins platform

    Digital Twin projects require your app to have an app identifier, which identifies your app in the Digital Twin services.

    Create an app identifier

    To create an app identifier, follow these steps:

    1. Log into the Digital Twins Portal.
    2. Go to the Identity swagger page.
    3. Use GET /api/auth/userinfo > [Try it out] > Execute to expose information about your Unity account. The response should look like the following:
        {
            "Id": "USER_ID",
            "Name": "USER_NAME",
            "Email": "USER_MAIL",
            "Organizations": [
                {
                    "Id": "ORG_ID",
                    "Name": "ORG_NAME",
                    "AllowCreateNewProject": true,
                    "IsPrimaryOrg": false,
                    "AllowRequestLicense": true,
                    "Role": "USER_ROLE"
                }
            ],
            // ...
        }
    

    You might have multiple organizations in your response, if your unity account belongs to multiple organizations. Select a target organization to register your app to, and copy its ORG_ID.

    1. Use POST /api/applications > [Try it out].
    2. Provide the ORG_ID that you previously fetched and then select a Name and DisplayName (refer to the following descriptions for more information):

      • Name: A unique alphanumeric app name that's lowercase and between 4 and 10 characters.
      • DisplayName: An arbitrary display name.
    3. Select Execute. The following is an example of the response:

        {
            "Id": "string",
            "Name": "string",
            "DisplayName": "string"
        }
    

    Note: The URLs must be slightly adapted if you want to generate an API token on a different cloud environment than production.

    Set up the app identifier

    To set up the app identifier, follow these steps:

    1. Open your app project in the Unity Editor.
    2. Go to Edit > Project Settings > Digital Twins > App Registration.
    3. Enter your app identifier in the App Id field. Entering the app identifier in Project Settings

    4. Select Refresh to update the app data in the Digital Twins Portal. Your project is now setup.

    Supported platforms

    • Unity Editor
    • Windows Standalone
    • WebGL
    • Android
    • Linux
    • MacOS
    • iOS: Requires an Xcode project build and a valid development build certificate to achieve binding for the custom URI scheme at the OS level.
    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