Getting "unauthorized_client" error while regenerating new Microsoft token in OAuth 2.0 client credentials flow

Test User 21 Reputation points
2022-05-24T14:02:33.903+00:00

We are using OAuth 2.0 client credentials flow for admin authentication. We are using this API to regenerate the admin oauth token. But we are getting the below error for a user when generating the token after token becomes invalid. Can you please advise on this?

   {"error":"unauthorized_client","error_description":"AADSTS7000112: Application 'xxxxxxxxxxxxxxxxxx'(<app-name>) is disabled.\r\nTrace ID: ec4b3557-143a-4020-9651-5cdaf0f83900\r\nCorrelation ID: 97a\r\nTimestamp: 2022-04-28 00:3sdew34fdddddddddd7:47Z","error_codes":[7000112],"timestamp":"2022-04-28 00:37:47Z","trace_id":"ec4b3557-143a-4020-9651-5cdaf0f83900","correlation_id":"9e5ewferferfge753476fergerf97a"}  
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,520 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 36,736 Reputation points
    2022-05-25T02:04:06.41+00:00

    Hi @Test User

    Your application object appears to be disabled.

    Go to the Azure portal and log in with administrator > Azure AD > Enterprise applications. Search for your app (if it doesn't show up initially, make sure you've selected "All Applications", under "Application Type"). Choose the app, and in the new blade, choose "Properties", on the left.

    If "Enabled for users to sign in?" is set to "No", then the app is disabled in that tenant. Setting it to "Yes" will enable it.

    205249-2022-05-25-095507.png


    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.

    2 people found this answer helpful.