Skip to content

Commit

Permalink
Change additional auth context type and log at appropriate step
Browse files Browse the repository at this point in the history
  • Loading branch information
Ndiritu committed Oct 30, 2024
1 parent 6db569f commit 4c1f70c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/http/httpClient/Middleware/AuthorizationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
}

private async Task AuthenticateRequestAsync(HttpRequestMessage request,
Dictionary<string, object>? additionalAuthenticationContext,
Dictionary<string, object> additionalAuthenticationContext,
CancellationToken cancellationToken,
Activity? activityForAttributes)
{
Expand All @@ -98,8 +98,8 @@ private async Task AuthenticateRequestAsync(HttpRequestMessage request,
var accessToken = await accessTokenProvider.GetAuthorizationTokenAsync(
request.RequestUri,
additionalAuthenticationContext, cancellationToken).ConfigureAwait(false);
if(string.IsNullOrEmpty(accessToken)) return;
activityForAttributes?.SetTag("com.microsoft.kiota.handler.authorization.token_obtained", true);
if(string.IsNullOrEmpty(accessToken)) return;
request.Headers.TryAddWithoutValidation(AuthorizationHeader, $"Bearer {accessToken}");
}
}
Expand Down

0 comments on commit 4c1f70c

Please sign in to comment.