This file contains hidden or 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
| /** | |
| 1. Create a.NET Core console client app. | |
| 2. Add a new Json file named "appsettings.json" in your project, set it property "Copy to output directory" to "Copy if newer". | |
| 3. Add the following lines in the appsettings.json | |
| { | |
| "Instance": "https://login.microsoftonline.com/", | |
| "ClientId": "The clientid/appid that you got from the app registration", | |
| "TenantId": "Your Azure AD tenant's id (a guid)", | |
| "RedirectUri": "http://localhost", | |
| "TenantDomain": "Your tenant's domain, like <mytenant>.onmicrosoft.com", |
This file contains hidden or 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
| ** This builds on the previous sample code provided at https://gist.github.com/kalyankrishna1/0a6ea6d00a09f7ae81c89960e1038d79 | |
| -------------------------- | |
| 2. Add the following using statements on top of the class | |
| using Microsoft.Extensions.Configuration; | |
| using Microsoft.Graph; | |
| using Microsoft.Identity.Client; | |
| using Newtonsoft.Json; | |
| using Newtonsoft.Json.Linq; |
This file contains hidden or 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
| /** | |
| 1. Create a.NET Core console client app. | |
| 2. Add a new Json file named "appsettings.json" in your project, set it property "Copy to output directory" to "Copy if newer". | |
| 3. Add the following lines in the appsettings.json | |
| { | |
| "Instance": "https://login.microsoftonline.com/", | |
| "ClientId": "The clientid/appid that you got from the app registration", | |
| "TenantId": "Your Azure AD tenant's id (a guid)", | |
| "RedirectUri": "http://localhost", | |
| "TenantDomain": "Your tenant's domain, like <mytenant>.onmicrosoft.com", |