Class AuthenticatorAbstract

Abstract class with utitily functions for working with access tokens such as storage

Hierarchy

Constructors

Properties

_accessToken?: string
_authInProgress: boolean = true
_expires?: number
_tokenCache: TokenCache
_waitForAccessToken: Promise<string> = ...

A Promise that delays any operation until an access token is set (with intervals of 50ms) This is used to delay incoming request from our app when an access token is already being requested but has not yet been received.

Accessors

  • get accessToken(): Promise<undefined | string>
  • Promise that will resolve with an access token if available or undefined otherwise. This will try to fetch a new access token if:

    • the class implements the fetchAccessToken method
    • no unexpired access token is stored in this class

    Returns Promise<undefined | string>

Methods

  • Abstract method that must be implemented by extending classes for specific OAuth 2.0 grants/flows.

    Returns Promise<undefined | {
        accessToken: string;
        expiresIn: number;
    }>

  • Puts an access token and the expiration time in storage for usage when calling Spinque Query API

    Parameters

    • accessToken: string
    • expiresIn: number

    Returns void

Generated using TypeDoc