Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created December 13, 2015 23:17
Show Gist options
  • Save justinyoo/52c28375b1867b24f650 to your computer and use it in GitHub Desktop.
Save justinyoo/52c28375b1867b24f650 to your computer and use it in GitHub Desktop.
Web API App-Only with Graph API
[HttpGet]
public async Task<IActionResult> Get()
{
AuthenticationResult authResult;
try
{
authResult = await this._authContext.AcquireTokenAsync(this._graphUrl, this._credential);
}
catch (Exception ex)
{
var result = new JsonResult(ex);
return result;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment