How to fix error application identifier Uri is invalid

Saffar 0 Reputation points
2024-04-11T23:43:35.7333333+00:00

I am trying to give API Access and I am for some reason getting an error telling me:"Error ensuring domain-wide principals: The application identifier uri 'api://-------------------/microsoft.spfx3rdparty.com' is invalid."

I have checked in my app registrations and I dont have any applications which matches the applications ID in Azure (Entra).

How can I solve this problem?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,680 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Pinaki Ghatak 2,400 Reputation points Microsoft Employee
    2024-04-12T08:20:32.4366667+00:00

    Hello @Saffar

    This error message indicates that the URI you are using is not valid.

    To fix this issue, you can try the following steps:

    1. Check the URI you are using and make sure it is correct. The URI should be in the format api://{Application ID}. You can find the Application ID in the Azure portal under the "App registrations" section.
    2. Make sure that the Application ID you are using is correct and matches the one in the Azure portal.
    3. If you are still having issues, try creating a new application registration in the Azure portal and use the new Application ID and URI.

  2. Marilee Turscak-MSFT 34,036 Reputation points Microsoft Employee
    2024-04-12T19:11:53.2433333+00:00

    @Saffar ,

    For Sharepoint framework API permissions I believe you need to add the user_impersonation scope in the SharePoint Admin Center API permissions page if you have not done so already.


  3. Pinaki Ghatak 2,400 Reputation points Microsoft Employee
    2024-04-23T12:21:19.47+00:00

    Hello @Saffar

    Please know, that just creating an app registration is not enough unless you also establish the federated ID, and then give it proper scope and authorizations. The following steps should be done:

    https://learn.microsoft.com/en-us/graph/auth-register-app-v2

    https://learn.microsoft.com/en-us/graph/auth-v2-user?tabs=http

    https://learn.microsoft.com/en-us/graph/traverse-the-graph?tabs=httphttps://learn.microsoft.com/en-us/graph/auth/auth-concepts