Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a 'event as online meeting' or only the onlineMeeting using Microsoft Graph API

Any user who logged into our system (IdentityServer as Auth) under a specific tenant should be able to create an event as an online meeting (MS Teams).

We followed Build ASP.NET Core MVC apps with Microsoft Graph and Create and enable an event as an online meeting to create an application that authenticates an AD user of an organization and allow him to create an event as an online meeting.

We are able to implement it successfully and was able to create the event as an online meeting.

But the exact scenario here is any user who is authenticated in our web application (not a AD user) should be able create a MS Teams meeting event and share it with other participants who should be able to join the meeting.

I am not sure how to achieve this.

Edit

Or at least how do I create onlineMeeting ? I tried with Client credentials provider as below

IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder
    .Create("<<App_Id>>")
    .WithTenantId("<<Tenant_Id>>")
    .WithClientSecret("<<Client_Secret>>")
    .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;

but it was throwing

Code: Forbidden
Inner error:
    AdditionalData:
    request-id: <<some_id>>
    date: 2020-07-09T16:42:23
ClientRequestId: <<some_id>>
like image 305
Gopi Avatar asked Jun 24 '20 12:06

Gopi


People also ask

Is Microsoft Graph API a REST API?

Microsoft Graph is a RESTful web API that enables you to access Microsoft Cloud service resources.


1 Answers

I been working on your question in few days, I was going to mention some of the suggestions comes with the other answer. But in addition, the main challenge here, the system need to know who is authorized to do what.

So IMO The Best choice to solve this is creating a guest login in AzureAD, than you can use that to create a Team Events. Further more you can added an extra step after guest user logon, so that guest should enter his/her name and use it as reference.

like image 72
Maytham Avatar answered Oct 23 '22 05:10

Maytham