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

    • Unity.DigitalTwins.Identity
      • AuthenticationState
      • BrowserAuthenticatedAccessTokenProvider
      • CommandLineAccessTokenProvider
      • DeviceToken
      • HttpPkceRequestHandler
      • IActivatePlatformSupport
      • IAuthenticator
      • IInteractiveAuthenticator
      • IPkceConfigurationProvider
      • IPkcePlatformSupport
      • IPkceRequestHandler
      • IPreAuthenticatedAccessTokenProvider
      • IUserInfoProvider
      • LaunchArgumentsParser
      • LicenseInfo
      • LicenseType
      • OrganizationInfo
      • PersonalAccessTokenProvider
      • PkceAuthenticator
      • PkceConfiguration
      • PkceConfigurationProvider
      • PreAuthenticatedHostAccessTokenProvider
      • UserInfo
      • UserInfoProvider
    • Unity.DigitalTwins.Identity.Runtime
      • AndroidActivatePlatformSupport
      • AndroidPkcePlatformSupport
      • CompositeAuthenticator
      • EditorActivateFromUrl
      • EditorActivatePlatformSupport
      • EditorPkcePlatformSupport
      • IosActivatePlatformSupport
      • IosPkcePlatformSupport
      • LinuxActivatePlatformSupport
      • LinuxPkcePlatformSupport
      • OsxActivatePlatformSupport
      • OsxPkcePlatformSupport
      • PlatformSupportFactory
      • WebglActivatePlatformSupport
      • WebglPkcePlatformSupport
      • WindowsActivatePlatformSupport
      • WindowsPkcePlatformSupport

    Class PersonalAccessTokenProvider

    An IAccessTokenProvider implementation that expects a PAT (personal access token) from a provided -DT_PERSONAL_ACCESS_TOKEN launch argument or a DT_PERSONAL_ACCESS_TOKEN environment variable.

    Inheritance
    Object
    PersonalAccessTokenProvider
    Implements
    Unity.DigitalTwins.Common.IAccessTokenProvider
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.DigitalTwins.Identity
    Assembly: solution.dll
    Syntax
    public class PersonalAccessTokenProvider : IAccessTokenProvider

    Constructors

    PersonalAccessTokenProvider(IActivatePlatformSupport)

    Returns an IAccessTokenProvider implementation that expects a PAT (personal access token) from a provided -DT_PERSONAL_ACCESS_TOKEN launch argument or a DT_PERSONAL_ACCESS_TOKEN environment variable.

    Declaration
    public PersonalAccessTokenProvider(IActivatePlatformSupport platformSupport = null)
    Parameters
    Type Name Description
    IActivatePlatformSupport platformSupport

    The IActivatePlatformSupport that handles launch arguments processing.

    Remarks

    A Unity User account is required to generate a valid PAT from the Unity Digital Twins online dashboard.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if Personal Access Token is missing in launch arguments or environment variables.

    Fields

    s_PersonalAccessTokenKeyName

    The expected key name in launch arguments that holds the personal access token value.

    Declaration
    public static readonly string s_PersonalAccessTokenKeyName
    Field Value
    Type Description
    String

    Methods

    GetAccessTokenAsync()

    Awaitable call to fetch the user access token.

    Declaration
    public Task<string> GetAccessTokenAsync()
    Returns
    Type Description
    Task<String>

    A Task that results in the string value of the user access token when completed.

    Implements

    Unity.DigitalTwins.Common.IAccessTokenProvider
    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