A cloud-based identity and access management service for securing user authentication and resource access
SharePoint and Microsoft Graph Sites.Selected behave differently depending on the type of identity and token used. The available guidance in the context shows:
-
Sites.Selectedis enforced per site, and access is granted only when:- The app has the
Sites.Selectedapplication permission. - A per-site permission (for example
write) is granted via Microsoft Graph or PnP PowerShell. - The app uses an application-only access token (no user) to call SharePoint/Graph.
- The app has the
- When these conditions are met, application-only access works for standard Microsoft Entra app registrations (service principals) and is explicitly documented and supported.
- For the SharePoint tool with the agent API, the documentation explicitly states that application-only authentication is not supported and that user identity (identity passthrough) is required; app-only OBO tokens are rejected with
AuthenticationError: AppOnly OBO tokens not supported by target service.
In the provided material, there is no statement that SharePoint or Microsoft Graph currently support app-only access using Microsoft Entra Agent ID identity tokens in the same way as standard service principals. The troubleshooting guidance for the SharePoint tool instead emphasizes that:
- Application-only identity is not supported for that tool.
- User identity passthrough is required.
Given this, the behavior described (standard service principal working with Sites.Selected while the agent identity fails with 401 "not allowed in this context") is consistent with a current limitation: the target SharePoint/Graph surface is not yet accepting app-only tokens issued for agent identities in the same way as for regular app registrations.
The context does not provide any indication that this is already supported for Entra Agent ID, nor does it provide a tracking item or ETA for enabling it. It only documents the general Sites.Selected model and the requirement for user identity in the SharePoint tool scenario.
The only fully documented and supported pattern in the context for SharePoint access is:
- Use a standard Microsoft Entra application registration with
Sites.Selectedapplication permission. - Grant per-site permissions via Microsoft Graph (
/sites/{siteId}/permissions) or PnP PowerShell (Grant-PnPAzureAdAppSitePermission). - Use an application-only token for that app to access the selected sites.
Until there is explicit documentation that SharePoint/Graph accept app-only agent identity tokens for Sites.Selected, the supported workaround based on the available material is to continue using a regular app registration/service principal for app-only Sites.Selected scenarios, or to use user identity passthrough where required.
References: