Skip to content

Commit 57f754b

Browse files
authored
Merge pull request #91395 from jmprieur/Fix40541
Fix #40541
2 parents 41fb0ba + 130a5be commit 57f754b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/active-directory/develop/scenario-web-app-call-api-acquire-token.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ public async Task<IActionResult> Profile()
5858
string[] scopes = new string[]{"user.read"};
5959
string accessToken = await tokenAcquisition.GetAccessTokenOnBehalfOfUserAsync(scopes);
6060

61-
// use the access token to call a protected web API
62-
HttpClient client = new HttpClient();
63-
client.DefaultRequestHeaders.Add("Authorization", result.CreateAuthorizationHeader());
64-
string json = await client.GetStringAsync(url);
61+
// use the access token to call a protected web API
62+
HttpClient client = new HttpClient();
63+
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
64+
string json = await client.GetStringAsync(url);
6565
}
6666
```
6767

0 commit comments

Comments
 (0)