Skip to content

Commit

Permalink
Using basic auth
Browse files Browse the repository at this point in the history
  • Loading branch information
daveaglick committed Dec 12, 2018
1 parent 1e1d7b5 commit 151180d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.1.1

- [Fix] Using basic auth instead of bearer token

# 0.1.0

- Initial release
8 changes: 6 additions & 2 deletions src/PipelinesTestLogger/LoggerQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 151180d

Please sign in to comment.