Show / Hide Table of Contents

    Class UserProfile

    Basic user that contains all the ApiData for storing purpose.

    Inheritance
    System.Object
    UnityEngine.Object
    UnityEngine.ScriptableObject
    UserProfile
    Namespace: Appearition.Profile
    Assembly: Appearition.SDK.dll
    Syntax
    [Serializable]
    [CreateAssetMenu(menuName = "Appearition/Create Basic User")]
    public class UserProfile : ScriptableObject

    Fields

    allTenantsAvailable

    Contains all the tenants available for this profile. Do note that by default, it only contains the selected tenant. If you want to see all tenants, trigger the AccountHandler.GetProfileData() request, and this list will be refreshed upon completion.

    Declaration
    public List<Tenant> allTenantsAvailable
    Field Value
    Type Description
    System.Collections.Generic.List<Tenant>

    anonymousToken

    EMS portal token. Can be found on the portal under Settings>Developer after selecting a tenant.

    Declaration
    public string anonymousToken
    Field Value
    Type Description
    System.String

    authenticationTokens

    Contains all the tokens currently active on this profile. If your application uses external cloud authentication with other tokens, feel free to store them here with a key of your choice.

    Declaration
    public Dictionary<string, string> authenticationTokens
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.String>

    nickname

    Nickname that can be used for profile selection.

    Declaration
    public string nickname
    Field Value
    Type Description
    System.String

    selectedChannel

    The product ID selected by the user. This corresponds to the channel ID.

    Declaration
    public int selectedChannel
    Field Value
    Type Description
    System.Int32

    selectedEndPointName

    Storage for the end point URL. Also used to fetch the selected end point.

    Declaration
    public string selectedEndPointName
    Field Value
    Type Description
    System.String

    selectedTenant

    The tenant index selected by the user.

    Declaration
    public string selectedTenant
    Field Value
    Type Description
    System.String

    Properties

    GetHighestLevelAuthenticationToken

    Fetches the most relevant Authentication Token, regardless the user's login state.

    Declaration
    public string GetHighestLevelAuthenticationToken { get; }
    Property Value
    Type Description
    System.String

    IsUserLoggedIn

    Defines whether or not the user has logged in and is in the middle of a session.

    Declaration
    public bool IsUserLoggedIn { get; }
    Property Value
    Type Description
    System.Boolean

    SelectedEndPoint

    Returns the user-selected end point URL.

    Declaration
    public EndPoint SelectedEndPoint { get; }
    Property Value
    Type Description
    EndPoint

    The selected end point.

    SessionToken

    Session Token, used by a logged-in user to execute requests which require a higher level of authentication.

    Declaration
    public string SessionToken { get; }
    Property Value
    Type Description
    System.String

    Methods

    AddOrModifyAuthenticationToken(String, String)

    Adds or creates a token entry based on a token name (key) and a token value (authentication token).

    Declaration
    public void AddOrModifyAuthenticationToken(string tokenName, string token)
    Parameters
    Type Name Description
    System.String tokenName
    System.String token

    CreateCopy<T>(UserProfile)

    Pseudo copy constructor. Creates a runtime copy from a given user profile.

    Declaration
    public static T CreateCopy<T>(UserProfile cc)
        where T : UserProfile
    Parameters
    Type Name Description
    UserProfile cc
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    GetAuthenticationHeaders(AuthenticationOverrideType, BaseApi)

    Gets the authentication headers for WebRequest used during API calls according to user-selected way of authentication.

    Declaration
    public Dictionary<string, string> GetAuthenticationHeaders(AuthenticationOverrideType requiredType, BaseApi requestSample = null)
    Parameters
    Type Name Description
    AuthenticationOverrideType requiredType
    BaseApi requestSample
    Returns
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.String>

    The get authentication headers.

    RemoveTokenIfExisting(String)

    Tries to find a matching token in the currently loaded tokens and remove said entry.

    Declaration
    public void RemoveTokenIfExisting(string token)
    Parameters
    Type Name Description
    System.String token

    Extension Methods

    ObjectExtension.ToStream(Object)
    Back to top Appearition SDK for Unity API