diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 2cebbb0..2570563 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,3 +1,7 @@ +# 0.1.1 + +- [Fix] Using basic auth instead of bearer token + # 0.1.0 - Initial release \ No newline at end of file diff --git a/src/PipelinesTestLogger/LoggerQueue.cs b/src/PipelinesTestLogger/LoggerQueue.cs index 5ac5b90..402af3f 100644 --- a/src/PipelinesTestLogger/LoggerQueue.cs +++ b/src/PipelinesTestLogger/LoggerQueue.cs @@ -22,8 +22,12 @@ internal class LoggerQueue private int totalSent = 0; public LoggerQueue(string accessToken, string apiUrl) - { - _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); + { + // The : character delimits username (which should be empty here) and password in basic auth headers + _client.DefaultRequestHeaders.Authorization + = new AuthenticationHeaderValue("Basic", + Convert.ToBase64String( + ASCIIEncoding.ASCII.GetBytes($":{ accessToken }"))); _apiUrl = apiUrl; _consumeTask = ConsumeItemsAsync(_consumeTaskCancellationSource.Token); }