Class Authentication

The Authentication API allows you to authenticate with the Time API.

Hierarchy

  • Authentication

Methods

  • Starts a new authentication session with the Time API, using the provided launch token from Fabric.

    This automatically sets the session for all future API requests. The session can then be accessed using Time.Configuration.session.

    Throws

    This request may fail with the following error codes:

    • ErrorCode.Unauthorised
    • ErrorCode.DifferentOrganisation

    Parameters

    • launchToken: string

      The launch token received from Infinity Fabric

    • organisationId: string

      The organisation ID to authenticate with

    Returns Promise<void>

  • When the access token of a session has expired, but the refresh token is still valid, this method can be used to refresh the session.

    • The access token is valid for up to 2 hours.
    • The refresh token is valid for up to 60 days.

    This automatically sets the new session for all future API requests, which is stored in Time.Configuration.session.

    Throws

    This request may fail with the following error codes:

    • ErrorCode.Unauthorised
    • ErrorCode.DifferentOrganisation

    Returns Promise<void>

  • Ends the current session. This will invalidate both the access token and refresh token.

    If the session has already expired, this method will do nothing.

    Returns Promise<void>