Home Reference Source
public class | source

AuthTokenManagers

You can directly use an instance of this class. authTokenManagers

Defines the object which holds the common AuthTokenManager used in the Driver

Method Summary

Public Methods
public

basic(param0: object): AuthTokenManager

Creates a AuthTokenManager for handle AuthToken and password rotation.

public

bearer(param0: object): AuthTokenManager

Creates a AuthTokenManager for handle AuthToken which is expires.

Public Methods

public basic(param0: object): AuthTokenManager source

Creates a AuthTokenManager for handle AuthToken and password rotation.

Warning: tokenProvider must only ever return auth information belonging to the same identity. Switching identities using the AuthTokenManager is undefined behavior.

Params:

NameTypeAttributeDescription
param0 object

The params

param0.tokenProvider function(): Promise<AuthToken>

Retrieves a new valid auth token. Must only ever return auth information belonging to the same identity.

Return:

AuthTokenManager

The basic auth data manager.

public bearer(param0: object): AuthTokenManager source

Creates a AuthTokenManager for handle AuthToken which is expires.

Warning: tokenProvider must only ever return auth information belonging to the same identity. Switching identities using the AuthTokenManager is undefined behavior.

Params:

NameTypeAttributeDescription
param0 object

The params

param0.tokenProvider function(): Promise<AuthTokenAndExpiration>

Retrieves a new valid auth token. Must only ever return auth information belonging to the same identity.

Return:

AuthTokenManager

The temporal auth data manager.