Created
December 6, 2017 16:16
-
-
Save HamidMosalla/bef98a46c40556c834f137704a05fa56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<IActionResult> CallApiUsingUserAccessToken() | |
{ | |
var accessToken = await HttpContext.GetTokenAsync("access_token"); | |
var client = new HttpClient(); | |
client.SetBearerToken(accessToken); | |
var content = await client.GetStringAsync("http://localhost:5001/api/resource-with-policy"); | |
return View("Json", content); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment