4

I am trying to create online meeting to get the joinurl from Microsoft Team Meeting using Graph SDK but I am getting Forbidden (403) error even after I had provided Application (With Admin Consent) and delegation permission to "OnlineMeetings.Read.All", "OnlineMeetings.Read", "OnlineMeetings.ReadWrite.All", "OnlineMeetings.ReadWrite".

Please see my code below and let me know what I am doing wrong or whether I need to provide any other permissions.

Below is my code :

 string[] graphScopes = { "OnlineMeetings.Read.All", "OnlineMeetings.Read", 
    "OnlineMeetings.ReadWrite.All", "OnlineMeetings.ReadWrite" };

        IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder
            .Create("55e5f6cf-****-****-****-4f23d6e****")
            .WithTenantId("****b9d4-4dbf-****-888f-21d*563b****")
            .WithClientSecret("********************************")
            .Build();


        ClientCredentialProvider authenticationProvider = new ClientCredentialProvider(confidentialClientApplication);

        GraphServiceClient graphClient = new GraphServiceClient(authenticationProvider);

        var onlineMeeting = new OnlineMeeting
        {
            StartDateTime = DateTimeOffset.Parse("2020-01-15T21:30:34.2444915+05:30"),
            EndDateTime = DateTimeOffset.Parse("2020-01-15T22:00:34.2464912+05:30"),
            Subject = "User Token Meeting"
        };

        var meeting = graphClient.Me.OnlineMeetings
              .Request()
              .AddAsync(onlineMeeting).Result;
Dominique
  • 16,450
  • 15
  • 56
  • 112
Tiru Jogu
  • 41
  • 3

1 Answers1

1

Create onlineMeeting only requires OnlineMeetings.ReadWrite Delegated Permission.

So it requires user + app authorization rather than app-only authorization.

In this case, you are using Client credentials provider, which means app-only authorization.

You should use Authorization code provider to get the access token, which will include OnlineMeetings.ReadWrite Delegated Permission.

Allen Wu
  • 15,529
  • 1
  • 9
  • 20
  • Can you help me on this? https://stackoverflow.com/questions/62555532/create-a-event-as-online-meeting-using-microsoft-graph-api – Gopi Jul 09 '20 at 16:04