Troubleshoot SharePoint REST API Tokens in Office 365
Question details
Troubleshoot authentication errors when using client credentials to call the SharePoint REST API.

- Product
- SharePoint Online and Microsoft 365
- Device & OS
- not provided
- Scenario
- A developer is integrating a third-party application with SharePoint using app-only access tokens.
- Observed behavior
- API requests return errors such as AudienceUriValidationFailedException or Unsupported app only token.
Identify the exact API endpoint, token request parameters, authentication method, and app permissions used. Keep access tokens, client secrets, certificates, and other sensitive values private when sharing diagnostic details.
Check the token audience and app-only permissions
Use these checks to identify common mismatches between the token, API endpoint, and SharePoint app-only authentication method.
Inspect the request URL in your application. A SharePoint REST request typically uses your tenant's SharePoint host and an /_api/ path; Microsoft Graph requests use graph.microsoft.com.
Inspect the access token's aud claim privately and verify that it identifies the API being called. For a Microsoft Entra v2 client-credentials request to SharePoint REST, request the scope https://<tenant>.sharepoint.com/.default; for Microsoft Graph, use https://graph.microsoft.com/.default instead.
In the Microsoft Entra admin center, open App registrations, select your app, and choose API permissions. Check that the appropriate application permissions are configured for SharePoint or Microsoft Graph, as applicable, and that required admin consent has been granted.
For direct SharePoint Online REST app-only access through Microsoft Entra ID, use certificate-based authentication. If your app uses a client secret, review whether a supported Microsoft Graph endpoint can perform the same operation instead.

Ask the SharePoint developer community for help
Use specialized developer support if the audience, permissions, and credential checks do not resolve the error.
Use WPS Office as an alternative for everyday documents
WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility, making it easy to move everyday document work. It does not resolve SharePoint API authentication errors.

Frequently Asked Questions
Why does SharePoint return an audience validation error?
The access token may have been issued for a different API. Compare the token's aud claim with the request endpoint, and request a SharePoint-scoped token for SharePoint REST rather than using a Microsoft Graph token.
Can I use a client secret for SharePoint REST app-only access?
For direct SharePoint Online REST app-only access through Microsoft Entra ID, use certificate-based authentication. If you need to use a client secret, check whether Microsoft Graph supports the operation you need.
Where can I check my application's permissions?
In the Microsoft Entra admin center, go to App registrations, select the application, and open API permissions. Verify the relevant application permissions and admin consent; site-specific permissions may also require a separate site grant.
What should I include when asking for developer support?
Include a sanitized token request, API endpoint and method, relevant claims, permissions, and the full error message. Do not post access tokens, client secrets, or certificate material.




