Exemplo n.º 1
0
        protected override async Task <HttpResponseMessage> SendAsync(
            HttpRequestMessage request,
            CancellationToken cancellationToken)
        {
            request.Headers.Authorization =
                new AuthenticationHeaderValue("Bearer", await _credentialProvider.GetBearerToken(cancellationToken));

            return(await base.SendAsync(request, cancellationToken).ConfigureAwait(false));
        }
Exemplo n.º 2
0
 public Task <string> GetBearerToken(CancellationToken cancellationToken)
 {
     return(_credentialProvider.GetBearerToken(cancellationToken));
 }