Do I have to update the access token every time creating a Teams online meeting? - Microsoft Graph Teams

Viewed 35

I would like to allow users of my application to create online meetings from my application via Graph API. The users do not log in to their Microsoft accounts, but my app gets the access token and creates the meeting on their behalf.

The problem is that the access token needed to create an online meeting expires in 3599 seconds.

Currently, I'm thinking of implementing a way to get an access token every time a meeting is created, but I would like to simplify it.

What do you do in this situation? Do you make the access token expire in 90 days, or is there a better way?

I would appreciate any advice you can give me.

I'm planning to implement the following steps.

  1. Get an access token

    POST https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token HTTP/1.1
    Host: login.microsoftonline.com
    Content-Type: application/x-www-form-urlencoded
    
    client_id=MyAppClientID
    &scope=https%3A%2F%2Fgraph.microsoft.com%2F.default
    &client_secret=MyAppClientSecretPassword
    &grant_type=client_credentials
    
  2. Create an online meeting

    POST https://graph.microsoft.com/v1.0/me/onlineMeetings
    Content-Type: application/json
    
    {
    "startDateTime":"2019-07-12T14:30:34.2444915-07:00",
    "endDateTime":"2019-07-12T15:00:34.2464912-07:00",
    "subject":"User Token Meeting"
    }
    

Best regards.

0 Answers
Related