0

I'm using MS.Graph and trying to get a list of my OneNote Notebooks.

Here is the code I'm using.

IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder
.Create(clientId)
.WithTenantId(tenantID)
.WithClientSecret(clientSecret)
.Build();

ClientCredentialProvider authProvider = new ClientCredentialProvider(confidentialClientApplication);

GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var notebooks = await graphClient.Me.Onenote.Notebooks
    .Request()
    .GetAsync();

I can get the clientID, but where/how to I get the tenantID and clientSecret?

Trey Balut
  • 1,355
  • 3
  • 19
  • 39

2 Answers2

0

You might be able to get more info through this reference: https://learn.microsoft.com/en-us/graph/sdks/choose-authentication-providers?tabs=CS#client-credentials-provider

Manjusha
  • 538
  • 2
  • 4
0

I used Microsoft.Graph.Auth (Pre-Release) from NuGet. That fixed the problem

Trey Balut
  • 1,355
  • 3
  • 19
  • 39