File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
articles/active-directory/develop Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,10 @@ public async Task<IActionResult> Profile()
58
58
string [] scopes = new string []{" user.read" };
59
59
string accessToken = await tokenAcquisition .GetAccessTokenOnBehalfOfUserAsync (scopes );
60
60
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 );
65
65
}
66
66
```
67
67
You can’t perform that action at this time.
0 commit comments