From 923c1de51a079e2754342987a8652ddb1b41c669 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Fri, 23 Jul 2021 05:52:41 +0100 Subject: [PATCH] Token added to http requests --- FileProcessor.Client/FileProcessorClient.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/FileProcessor.Client/FileProcessorClient.cs b/FileProcessor.Client/FileProcessorClient.cs index 9c809ca..a2254cf 100644 --- a/FileProcessor.Client/FileProcessorClient.cs +++ b/FileProcessor.Client/FileProcessorClient.cs @@ -65,6 +65,9 @@ public async Task GetFile(String accessToken, try { + // Add the access token header + this.HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); + // Make the Http Call here HttpResponseMessage httpResponse = await this.HttpClient.GetAsync(requestUri, cancellationToken); @@ -111,6 +114,9 @@ public async Task GetFileImportLog(String accessToken, try { + // Add the access token header + this.HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); + // Make the Http Call here HttpResponseMessage httpResponse = await this.HttpClient.GetAsync(requestUri, cancellationToken); @@ -160,6 +166,9 @@ public async Task GetFileImportLogs(String accessToken, try { + // Add the access token header + this.HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); + // Make the Http Call here HttpResponseMessage httpResponse = await this.HttpClient.GetAsync(requestUri, cancellationToken);