Graph API not working in SPFX webpart for few tenants

Ankush Dhingra 0 Reputation points
2025-03-06T11:31:32.1933333+00:00

In SPFx webpart trigger Graph call and got console error "Error: To view the information on this page, ask a global or SharePoint admin in your organization to go to the API management page in the new SharePoint admin center." and for one tenant it was showing "Token request permission failed"

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,406 questions
{count} votes

1 answer

Sort by: Most helpful
  1. FrankEscarosBuechsel-MSFT 895 Reputation points Microsoft Employee
    2025-03-11T20:19:17.4466667+00:00

    Hi @Ankush Dhingra

    After reviewing the collected trace from connecting offline it looks like the Client Secret being used by the SharePoint Online Web Client Extensibility is invalid, very similar to the issue and solution described in this Github Issue, when reviewing the logging internally you were getting the same error message that was present in that particular issue.

    Can you please follow the same steps, I will outline them below for your convenience as well and see if this resolves your problem?

    1. Go to portal.azure.com as an Cloud Application Administrator or Global Administrator
    2. Click App Registrations
    3. Search for SharePoint Online Client Extensibility Web Application Principal
    4. Look at "Certificates & secrets" in the left hand nav
    5. Delete the only secret that exists
    6. Wait about 1 minute for the deletion to propagate
    7. Go to SharePoint Tenant Admin
    8. Expand Advanced in the left nav
    9. Click API Access
    10. Let the page load (just leave it open, this will ensure that your app registration is created)
    11. Go back to Certificates & Secrets in the Azure portal and confirm you have a new client secret

    This should resolve the invalid Client Secret and make the call to the Graph API succeed again, please let me know if this does indeed resolve your issue.


    If this answer is helpful, please click Accept Answer and kindly upvote it. 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.