ITokenProvider Interface

Packages > @fluidframework/routerlicious-driver > ITokenProvider

The ITokenProvider abstracts the token fetching mechanism for a host. Host will be responsible for implementing the interfaces.

Signature:

export interface ITokenProvider 

Methods

List of methods of this class
Method Description
fetchOrdererToken(refresh) Fetches the orderer token from host
fetchStorageToken(refresh) Fetches the storage token from host

Methods

fetchOrdererToken

Fetches the orderer token from host

Signature:

fetchOrdererToken(refresh?: boolean): Promise<ITokenResponse>;

Parameters

List of parameters
Parameter Type Description
refresh boolean Optional flag indicating whether token fetch must bypass local cache

Returns:

Promise<ITokenResponse>

TokenResponse object representing token value along with flag indicating whether token came from cache.

fetchStorageToken

Fetches the storage token from host

Signature:

fetchStorageToken(refresh?: boolean): Promise<ITokenResponse>;

Parameters

List of parameters
Parameter Type Description
refresh boolean Optional flag indicating whether token fetch must bypass local cache

Returns:

Promise<ITokenResponse>

TokenResponse object representing token value along with flag indicating whether token came from cache.