Skip to content

Latest commit

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

GraphConnectApi

Introduction

Console application .Net 7.0 with DI User with authentication "App-only access (access without a user)"

Upload file to default site of SharePoint Site (Shared Documents), and then download it.

Step 1 : Register the app in Azure with a "basic" user of AD organization.
recording-2023-03-13-16-51-44.webm
Step 2 : Apply "Admin consent required" with the "admin" user of AD organization.
recording-2023-03-13-16-58-44.webm
Step 3 : Login through the console application:
string[]scopes={"https://graph.microsoft.com/.default"};ClientSecretCredentialclientSecretCredential=new("695cecd9-6b4e057a....",// TENANT ID"267a56e2-cbe82623.....",// CLIENT ID"BbJ8Q~Ttv8lMxYIs.....",// SECRETnew(){AuthorityHost=AzureAuthorityHosts.AzurePublicCloud});GraphServiceClientgraphClient=new(clientSecretCredential,scopes);
Step 4 : Callig Api Graph:
awaitgraphClient.Drives[id!.Id].Root.ItemWithPath("Hack Together Microsoft Graph and .NET Calendar.ics").Content.PutAsync(stream,null,newCancellationToken());

Hack Together: Microsoft Graph and .NET

About

Conneting Sharepoint drive with Graph Api Microsoft.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages