Microsoft.Graph.ServiceException - AuthenticationError

iTech Software Group 0 Reputation points
2025-04-08T13:51:00.12+00:00

I have purchased the SPO license, but when I try to access OneDrive through the Graph API, I encounter the following error:

HResult=0x80131500

Message=Code: AuthenticationError

Message: AADSTS500014: The service principal for the resource is disabled. This indicates that a subscription within the tenant has lapsed, or that the administrator for this tenant has disabled the application, preventing tokens from being issued for it.

Please help me resolve this error.

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

1 answer

Sort by: Most helpful
  1. Saranya Madhu-MSFT 2,295 Reputation points Microsoft External Staff
    2025-04-09T04:24:51.6833333+00:00

    Hi iTech Software Group,

    Thanks for reaching out to Microsoft!

    To resolve this issue, first ensure that your subscription is active and compliant, as a lapsed subscription could be the cause.

    If you already have an active, compliant subscription and the application is enabled for user sign-in, I will also recommend trying these steps:

    • Verify if the application is enabled in the Entra portal. Make sure that the application is not disabled by the administrator. You can check this by going to the "App registrations" in the portal.

    Ensure that the necessary permissions are granted to the application.

    If the service principal is disabled, you can re-enable it using Microsoft Graph. Send a PATCH request to /servicePrincipals/{servicePrincipalObjectId} with the following payload:

    {
        "accountEnabled": true
    }
     
    

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.