IOdspTokenProvider Interface
Abstracts the token fetching mechanism for a hosting application. The hosting application is responsible for providing an implementation.
To use, import via @fluidframework/odsp-client/beta
.
For more information about our API support guarantees, see here.
Signature
export interface IOdspTokenProvider
Methods
Method | Alerts | Return Type | Description |
---|---|---|---|
fetchStorageToken(siteUrl, refresh) | Beta |
Promise<TokenResponse> | Fetches the storage token from host. |
fetchWebsocketToken(siteUrl, refresh) | Beta |
Promise<TokenResponse> | Fetches the orderer token from host. |
Method Details
fetchStorageToken
Fetches the storage token from host.
To use, import via @fluidframework/odsp-client/beta
.
For more information about our API support guarantees, see here.
Signature
fetchStorageToken(siteUrl: string, refresh: boolean): Promise<TokenResponse>;
Parameters
Parameter | Type | Description |
---|---|---|
siteUrl | string | Site url representing ODSP resource location. It points to the specific SharePoint site where you can store and access the containers you create. |
refresh | boolean |
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: |
Returns
Return type: Promise<TokenResponse>
fetchWebsocketToken
Fetches the orderer token from host.
To use, import via @fluidframework/odsp-client/beta
.
For more information about our API support guarantees, see here.
Signature
fetchWebsocketToken(siteUrl: string, refresh: boolean): Promise<TokenResponse>;
Parameters
Parameter | Type | Description |
---|---|---|
siteUrl | string | Site url representing ODSP resource location. It points to the specific SharePoint site where you can store and access the containers you create. |
refresh | boolean |
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: |
Returns
Return type: Promise<TokenResponse>