Using The Microsoft Graph API with C#



Using The Microsoft Graph API with C#

Using The Microsoft Graph API with C#

Join me in taking a look at how you can use the Graph API/SDK alongside C# in your projects. In this video we’ll cover how to find the calls you need to make, what permissions you’ll need, how to create an entreprise application, what packes are needed and a few examples of how you can call the API using the SDK in C#.

We’re using a client secret to connect as an application, in case you want to see how to create a multi tenant application with access to multiple tenants, let me know and i’ll create a video on that.

Source code used in the video: https://github.com/BlueHippoGithub/GraphBasics

Graph X-Ray: https://graphxray.merill.net/
Graph Permissions Explorer: https://graphpermissions.merill.net/

Support Merill for the awesome tools
YT: https://www.youtube.com/@merillx
Twitter: https://twitter.com/merill

Authorization code flow:
https://learn.microsoft.com/en-us/graph/sdks/choose-authentication-providers?tabs=csharp#authorization-code-provider
https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow

PowerShell commands for 99 year secret:

$startDate = Get-Date
$endDate = $startDate.AddYears(99)

New-AzureADApplicationPasswordCredential -ObjectId “OBJECTID” -CustomKeyIdentifier “IMAP Secret” -StartDate $startDate -EndDate $endDate

Comments are closed.