Microsoft Graph API - How to get refresh token for my application without a user

Relephant 46 Reputation points
2021-11-17T07:38:11.537+00:00

Hello.
I'm developing an application that allows users to create Teams online meetings. The users don't log in with their Microsoft account and my application creates the meeting on their behalf.

I have followed this page's procedure to get an access token for the application.

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  

But I couldn't get the refresh token following the above steps, so the process of getting the access token is required to create online meeting every time.

Is there any way to get the refresh token for the application without the user?

Best regards.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,582 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 36,896 Reputation points
    2021-11-17T08:26:44.25+00:00

    Hi @Relephant

    The client credential flow does not allow the issuance of refresh tokens.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful