Class Token | Unity Simulation Client | 0.0.10-preview.10
docs.unity3d.com
    Show / Hide Table of Contents

    Class Token

    Encapsulates the access token used to authenticate with the USim service.

    Inheritance
    Object
    Token
    Namespace: Unity.Simulation.Client
    Syntax
    public class Token

    Properties

    accessToken

    Returns the access token.

    Declaration
    public string accessToken { get; }
    Property Value
    Type Description
    String

    isExpired

    Returns true if the access token has expired, false otherwise.

    Declaration
    public bool isExpired { get; }
    Property Value
    Type Description
    Boolean

    Methods

    Load(String, Boolean)

    Loads a token from peristent storage.

    Declaration
    public static Token Load(string tokenFile = null, bool refreshIfExpired = true)
    Parameters
    Type Name Description
    String tokenFile

    Path to the token file to laod. Can be null. Defaults to ~/.usim/token.json

    Boolean refreshIfExpired

    When true, will automatically refresh the token if it has expired. Defaults to true.

    Returns
    Type Description
    Token

    Refresh(Int32)

    Refresh the current token.

    Declaration
    public void Refresh(int timeoutSeconds = 30)
    Parameters
    Type Name Description
    Int32 timeoutSeconds

    Timeout for attempting to refresh the token.

    Save(String)

    Saves this token to persisten storage.

    Declaration
    public void Save(string tokenFile = null)
    Parameters
    Type Name Description
    String tokenFile

    Path to the token file to laod. Can be null. Defaults to ~/.usim/token.json

    Back to top
    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