Skip to content

Commit 24b76e2

Browse files
Merge pull request #50 from TransactionProcessing/task/passaccesstokenonclient
Token added to http requests
2 parents 2584540 + 923c1de commit 24b76e2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

FileProcessor.Client/FileProcessorClient.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public async Task<FileDetails> GetFile(String accessToken,
6565

6666
try
6767
{
68+
// Add the access token header
69+
this.HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
70+
6871
// Make the Http Call here
6972
HttpResponseMessage httpResponse = await this.HttpClient.GetAsync(requestUri, cancellationToken);
7073

@@ -111,6 +114,9 @@ public async Task<FileImportLog> GetFileImportLog(String accessToken,
111114

112115
try
113116
{
117+
// Add the access token header
118+
this.HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
119+
114120
// Make the Http Call here
115121
HttpResponseMessage httpResponse = await this.HttpClient.GetAsync(requestUri, cancellationToken);
116122

@@ -160,6 +166,9 @@ public async Task<FileImportLogList> GetFileImportLogs(String accessToken,
160166

161167
try
162168
{
169+
// Add the access token header
170+
this.HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
171+
163172
// Make the Http Call here
164173
HttpResponseMessage httpResponse = await this.HttpClient.GetAsync(requestUri, cancellationToken);
165174

0 commit comments

Comments
 (0)