async loadToken(webResource) {
        let accessToken = this.tokenCache.getCachedToken();
        // If there's no cached token in the cache, we try to get a new one.
        if (accessToken === undefined) {
            const receivedToken = await this.credential.getToken(this.challengeCache.challenge.scope);
            accessToken = receivedToken || undefined;
            this.tokenCache.setCachedToken(accessToken);
        }
        if (accessToken) {
            webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${accessToken.token}`);
        }
    }
/**
     * Gets or updates the token from the token cache into the headers of the received web resource.
     */
Gets or updates the token from the token cache into the headers of the received web resource.
Gets or updates the token from the token cache into the headers of the received web resource .
async loadToken(webResource) {
        let accessToken = this.tokenCache.getCachedToken();
        if (accessToken === undefined) {
            const receivedToken = await this.credential.getToken(this.challengeCache.challenge.scope);
            accessToken = receivedToken || undefined;
            this.tokenCache.setCachedToken(accessToken);
        }
        if (accessToken) {
            webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${accessToken.token}`);
        }
    }
async loadToken ( webResource ) { let accessToken = this . tokenCache . getCachedToken ( ) ; if ( accessToken === undefined ) { const receivedToken = await this . credential . getToken ( this . challengeCache . challenge . scope ) ; accessToken = receivedToken || undefined ; this . tokenCache . setCachedToken ( accessToken ) ; } if ( accessToken ) { webResource . headers . set ( Constants . HeaderConstants . AUTHORIZATION , ` ${ accessToken . token } ` ) ; } }
Gets or updates the token from the token cache into the headers of the received web resource.
Gets or updates the token from the token cache into the headers of the received web resource .
// If there's no cached token in the cache, we try to get a new one.