기술 자료

​
​

Development

User Acquisition

Monetization

산업 분야

Unity Cloud

Get Started

Asset Manager SDKs and services

Open Unity Dashboard

Unity Cloud

이 페이지는 선택한 언어로 제공되지 않습니다.
​
​
Unity Dashboard
  • Accounts
  • Organizations
  • Projects
  • Products
  • Billing
Developer Data
  • Introduction to the Developer Data Framework
  • Get started
  • View Diagnostics for your project
  • Privacy and consent
Unity Asset Manager
  • What's new
  • Asset Manager web
  • Asset Store
  • Manage Assets in the Editor
  • Unity Version Control
  • Developer documentation
    • Asset Manager SDKs and services
    • Integrations
      • Get started with your Asset Manager integration
      • Unity Cloud Python SDK
        • Prerequisites
        • Get started
        • Security information
        • Manage Identity
        • Manage assets
        • Manage asset versions
        • Manage datasets and files
        • Manage metadata
        • Manage collections
        • Manage transformations
        • Manage asset status
        • Manage VCS integrations
        • Open Dashboard
        • Configure Self-Hosted Deployment
        • Samples
        • Configure logs
        • Troubleshooting
      • Unity Pipeline Automation
      • Asset Manager for Unity Asset Transformer Studio
      • Asset Manager for Blender
Unity Pipeline Automation
  • About
  • Get started
  • Pipelines
  • Automations
  • Monitor jobs
  1. Unity Cloud Documentation
  2. Asset Manager
  3. Unity Cloud Python SDK

Manage Identity

How to set up Identity to sign in and use the Python SDK.
읽는 시간 5분
최근 업데이트: 일 년 전

Unity Cloud services require the caller to be properly authorized before you can perform any operation or access other modules such as Assets.
There are two modules available to retrieve such authorization:
  • unity_cloud.identity.user_login
  • unity_cloud.identity.service_account
Only one module can be used at all time. Declaring
unity_cloud.identity.user_login.use()
prevents any call to the
unity_cloud.identity.service_account
module by throwing an exception.

How do I...?

Authenticate with a user login

The user sign-in process requires to:
  1. Manually request a sign-in (or a sign-out) from the integration.
  2. Enter your Unity account credentials to authenticate.
The user login implements the OAuth 2.0 PKCE standard flow to retrieve an access token, and relies on the default OS browser as an intermediary to authenticate.

Initialize and sign in to the Unity Dashboard

To use standard user login, follow these steps:
  1. Call
    unity_cloud.identity.user_login.use()
    to initialize the
    user_login
    module. This action automatically checks if any refresh token is currently cached. If so, you are authenticated.
  2. If there is no token, call
    login
    to trigger your browser to open and sign in to Unity Dashboard.
참고
unity_cloud.identity.user_login.use()
also gives access to the other methods in the
user_login
module:
login
,
logout
,
get_user_infos
, and
get_authentication_state
.
After you have signed in, a refresh token is automatically cached.
def initialize_user_login(): unity_cloud.initialize() unity_cloud.identity.user_login.use() auth_state = unity_cloud.identity.user_login.get_authentication_state() if auth_state != unity_cloud.identity.user_login.Authentication_State.LOGGED_IN: unity_cloud.identity.user_login.login()
참고
Calling
login
when the user is already considered signed in will generate an exception. To prevent this, you can validate the user's authentication state by calling
get_authentication_state
. * When using the
user_login
module, calls to the
service_account
module will return invalid operation exceptions. These modules are mutually exclusive.

Sign out

To sign out, follow these steps:
  1. Initialize the following modules in this order:
    1. unity_cloud
    2. unity_cloud.identity.user_login.use()
    3. (Optional)
      unity_cloud.identity.user_login.login
      . Read more about initializing and signing in the user through Unity Dashboard.
  2. Call the
    logout
    method with the
    clear_cache
    argument set to
    TRUE
    .
    Calling the method signs you out from the browser.
  3. (Optional) Set the
    clear_cache
    argument to
    FALSE
    to allow automatic re-login next time
    unity_cloud.identity.user_login.use()
    is called.
unity_cloud.identity.user_login.logout( clear_cache = True )

Get information about the current user

To retrieve all information on the current user, including their access token, call the
get_current_user_info
method.
user_infos = unity_cloud.identity.user_login.get_current_user_info()

Use a callback to track the authentication state during a user sign-in

Subscribing to the authentication state change allows you to get a callback every step of the authentication flow.
The states tracked are:
AWAITING_INITIALIZATION
,
AWAITING_LOGIN
,
LOGGED_IN
,
AWAITING_LOGOUT
, and
LOGGED_OUT
.
def auth_state_callback(state): print(state) unity_cloud.identity.user_login.subscribe( event_type = unity_cloud.identity.user_login.AUTHENTICATION_STATE_CHANGED_EVENT, callback = auth_state_callback ) unity_cloud.identity.user_login.login() unity_cloud.identity.user_login.logout(clear_cache = True) unity_cloud.identity.user_login.unsubscribe( event_type = unity_cloud.identity.user_login.AUTHENTICATION_STATE_CHANGED_EVENT, callback = auth_state_callback )

Use a service account to perform app-oriented authorization

The service account allows authorization for internal headless scenarios (automated scripts, tests, etc.).

Generate a service account

  1. Create a service account.
  2. Make sure to store the service account credentials (
    key ID
    and
    secret key
    ) in a secure and private location.
    Refer to these credentials in your integration to authorize your calls to Unity Cloud services.
  3. Attach the service account to an organization or a project.

Set up your app to use a service account

After the required
unity_cloud
initialization, pass the
key id
and
secret key
of your service account generated via the Dashboard.
참고
When using the
service_account
module, calls to the
user_login
module will return invalid operation exceptions. These modules are mutually exclusive.
key_id = "1234abcd-ab12-cd34-ef56-123456abcdef" key = "12345678ABCDefgh-1234AbC-5678eFg" unity_cloud.identity.service_account.use(key_id=key_id, key=key)

Get a list of the accessible organizations or projects

To get a list of accessible organizations or projects, follow these steps:
  1. Use the
    get_organization_list
    method to retrieve a list of all accessible organizations.
  2. Call
    get_project_list
    with an organization id to retrieve the accessible projects contained in it.
    • (Optional) Add the parameter
      limit_to
      to limit the amount of returned results. Leave it untouched or set it to 0 to return everything.
    • (Optional) Add the parameter
      skip
      to specify the number of collection to skip in the results. Use it in combination with limit_to to page through results.
orgs = unity_cloud.identity.get_organization_list() if len(orgs) != 0: projects = unity_cloud.identity.get_project_list(orgs[0].id) permissions = unity_cloud.identity.get_organization_permissions(orgs[0].id) roles = unity_cloud.identity.get_organization_roles(orgs[0].id)
The
get_organization_permissions
,
get_organization_roles
,
get_project_permission
and
get_project_roles
methods provide more granular information about roles and permissions that are inherited from whichever authorization flow you chose.

Create a project

To create a project, follow these steps:
  1. Create a
    ProjectCreation
    object with the name of the new project and optionally metadata.
  2. Call
    create_project
    with the
    ProjectCreation
    object and the organization ID.
project_creation = ProjectCreation(name="myNewProject")unity_cloud.identity.create_project(project_creation, org_id)

Get a project

To get a single project, call
get_project
with the organization and project IDs.
project = unity_cloud.identity.get_project(org_id, project_id)

List users in an organization

To list all users associated to an organization, call
get_organization_user_info_list
with the organization ID.
users = unity_cloud.identity.get_organization_user_info_list(org_id)

List users in a project

To list all users associated to a project, call
get_project_user_info_list
with the organization and project IDs.
users = unity_cloud.identity.get_project_user_info_list(org_id, project_id)

Get a single user

To get the info for a user, call
get_user_info
with the organization and user IDs.
user = unity_cloud.identity.get_user_info(org_id, user_id)

Copyright © 2026 Unity Technologies
법률 정보개인정보 처리방침쿠키Documentation Terms of Use개인 정보 판매 또는 공유 금지개인정보 보호 선택(쿠키 설정)

'Unity', Unity 로고 및 기타 Unity 상표는 미국 및 기타 지역 내 Unity Technologies 또는 그 계열사의 상표 또는 등록상표입니다(자세한 내용은 여기에서 확인하세요). 기타 명칭 또는 브랜드는 해당 소유자의 상표입니다.

일부 페이지는 편의를 위해 기계 번역되었으며 부정확한 내용이 있을 수 있습니다. 정보가 상충되는 경우, 영어 버전을 우선으로 참조하세요.

  • 보고 있는 페이지
    • How do I...?

      • Authenticate with a user login

        • Initialize and sign in to the Unity Dashboard

        • Sign out

        • Get information about the current user

        • Use a callback to track the authentication state during a user sign-in

      • Use a service account to perform app-oriented authorization

        • Generate a service account

        • Set up your app to use a service account

      • Get a list of the accessible organizations or projects

      • Create a project

      • Get a project

      • List users in an organization

      • List users in a project

      • Get a single user


이 페이지의 문제 보고