microsoftgraph / aspnet-snippets-sample

A repository of code snippets that use Microsoft Graph to perform common tasks such as sending email, managing groups, and other activities from an ASP.NET Core MVC app. This sample uses the Microsoft Graph .NET Client Library to work with data, and the Microsoft Identity Web Library for authentication on the Microsoft identity platform v2.0 endpoint.
MIT License
189 stars 101 forks source link

Calendar not working #67

Closed oobhave closed 3 years ago

oobhave commented 3 years ago

I am having trouble getting the Calendar section of this demo to work.

All other sections, Mail, Users, Groups, Teams and Files all ask for User authentication when selected the for first time. Calendar does not, it reports this instead:

Error getting calendar view Code: generalException Message: An error occurred sending the request.

I have tried adding Calender.ReadWrite to the API permissions for both Delegated and Application permissions but it makes no difference.

Any help or pointers appreciated.

jasonjoh commented 3 years ago

Thanks for reporting this @oobhave. The issue seems to be because the calendar controller is using it's own code to create the graph client rather than using the BaseController's method. I'll see if I can get a fix for this shortly.

jasonjoh commented 3 years ago

Try the updated code out and let me know if it doesn't work for you.

oobhave commented 3 years ago

Thank you for the speedy response and fix.

Works a treat!!!