Type alias Authenticate

Authenticate: {
    getAccessTokenForServiceAccount(saId?: string, saJwk?: JwkRsa): Promise<string>;
    getTokens(forceLoginAsUser?: boolean, autoRefresh?: boolean, types?: string[], callbackHandler?: CallbackHandler): Promise<Tokens>;
}

Type declaration

  • getAccessTokenForServiceAccount:function
    • Get access token for service account

      Parameters

      • Optional saId: string

        optional service account id

      • Optional saJwk: JwkRsa

        optional service account JWK

      Returns Promise<string>

      Access token or null

      Deprecated

      since v2.0.0 use getTokens instead

      getTokens(): Promise<boolean>
      
  • getTokens:function
    • Get tokens and store them in State

      Parameters

      • Optional forceLoginAsUser: boolean

        true to force login as user even if a service account is available (default: false)

      • Optional autoRefresh: boolean

        true to automatically refresh tokens before they expire (default: true)

      • Optional types: string[]

        Array of supported deployment types. The function will throw an error if an unsupported type is detected (default: ['classic', 'cloud', 'forgeops'])

      • Optional callbackHandler: CallbackHandler

        function allowing the library to collect responses from the user through callbacks

      Returns Promise<Tokens>

      object containing the tokens