Skip to main content
Version: v2

IOdspTokenProvider Interface

Abstracts the token fetching mechanism for a hosting application. The hosting application is responsible for providing an implementation.

This API is provided as a beta preview and may change without notice.

To use, import via @fluidframework/odsp-client/beta.

For more information about our API support guarantees, see here.

Signature​

export interface IOdspTokenProvider

Methods​

MethodAlertsReturn TypeDescription
fetchStorageToken(siteUrl, refresh)BetaPromise<TokenResponse>Fetches the storage token from host.
fetchWebsocketToken(siteUrl, refresh)BetaPromise<TokenResponse>Fetches the orderer token from host.

Method Details​

fetchStorageToken​

Fetches the storage token from host.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

fetchStorageToken(siteUrl: string, refresh: boolean): Promise<TokenResponse>;

Parameters​

ParameterTypeDescription
siteUrlstringSite url representing ODSP resource location. It points to the specific SharePoint site where you can store and access the containers you create.
refreshboolean

Optional flag indicating whether token fetch must bypass local cache. This likely indicates that some previous request failed authorization due to an expired token, and so a fresh token is required.

Default: false.

Returns​

Return type: Promise<TokenResponse>

fetchWebsocketToken​

Fetches the orderer token from host.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

fetchWebsocketToken(siteUrl: string, refresh: boolean): Promise<TokenResponse>;

Parameters​

ParameterTypeDescription
siteUrlstringSite url representing ODSP resource location. It points to the specific SharePoint site where you can store and access the containers you create.
refreshboolean

Optional flag indicating whether token fetch must bypass local cache. This likely indicates that some previous request failed authorization due to an expired token, and so a fresh token is required.

Default: false.

Returns​

Return type: Promise<TokenResponse>