-
-
Save justinyoo/52c28375b1867b24f650 to your computer and use it in GitHub Desktop.
Web API App-Only with Graph API
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
[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