class MAGES::UserAuthentication::MagesClientCredentialsConfig

Overview

Build-time baked JWT for the developer who produced this build, plus the developer’s identity (userId, tenant). Read at runtime by MAGESUserAuthentication so JARIA and Analytics can authenticate against the MAGES backend without an end-user login and without an HTTP round-trip to LoginAzure to fetch the user record. Written by the editor-side baker on build preprocess. More…

class MagesClientCredentialsConfig: public ScriptableObject
{
public:
    // fields

    static const string ResourcePath = "MAGES/MagesClientCredentials";

    // properties

    string AccessToken;
    DateTimeOffset ExpiresAt;
    string UserId;
    string TenantId;
    string OrganizationName;
    string Email;
    License.? LicenseType LicenseType;
    bool HasBakedToken;

    // methods

    static MagesClientCredentialsConfig Load();

    void SetBakedToken(
        string token,
        long expiresAt,
        string userId,
        string tenantId,
        string organizationName,
        string email,
        License.LicenseType? licenseType = null
    );
};

Detailed Documentation

Build-time baked JWT for the developer who produced this build, plus the developer’s identity (userId, tenant). Read at runtime by MAGESUserAuthentication so JARIA and Analytics can authenticate against the MAGES backend without an end-user login and without an HTTP round-trip to LoginAzure to fetch the user record. Written by the editor-side baker on build preprocess.

Fields

static const string ResourcePath = "MAGES/MagesClientCredentials"

The Resources path (without the .asset extension) at which the config is loaded.

Properties

string AccessToken

Gets the developer’s baked JWT.

DateTimeOffset ExpiresAt

Gets the JWT’s absolute expiration time.

string UserId

Gets the developer’s user id (subject of the baked JWT).

string TenantId

Gets the developer’s tenant id (GUID).

string OrganizationName

Gets the developer’s organization name — the value JARIA and Analytics services use to scope per-tenant data.

string Email

Gets the developer’s email (informational; not used to authenticate).

License.? LicenseType LicenseType

Gets the developer’s license type, if it was baked into this asset.

bool HasBakedToken

Gets a value indicating whether a non-empty token has been baked into this asset.

Methods

static MagesClientCredentialsConfig Load()

Loads the baked config from Resources, or returns null if it has not been baked yet.

Returns:

The baked MagesClientCredentialsConfig, or null when no asset exists.

void SetBakedToken(
    string token,
    long expiresAt,
    string userId,
    string tenantId,
    string organizationName,
    string email,
    License.LicenseType? licenseType = null
)

Editor-only setter used by the build-preprocess baker. The baker is the only intended writer; runtime code is expected to read via the public properties.

Parameters:

token

The JWT minted by POST /api/developers/login-token.

expiresAt

The token’s absolute expiration (Unix seconds).

userId

The developer’s user id.

tenantId

The developer’s tenant id (GUID).

organizationName

The developer’s organization name.

email

The developer’s email.

licenseType

The developer’s license type.