I registered an app in Azure Active Directory and granted several privileges:

enter image description here

Then I got myself a bearer token by calling:


with the scope:


When I use that token to make an API call like:

https://infoinnobake.sharepoint.com/_api/search/query?querytext='contentclass:STS_Site contentclass:SP.Webb'&selectproperties='Title,Path'&rowlimit=500`

I only reveice 401 Unsupported app only token.

can some explain why?

Is it possible to access the SharePoint online API with an registered App on Azure AD?


2 Answers 2


In Order to call SharePoint Online API using Azure AD Registered App, you need to Set up an Azure AD app for app-only access and grant the permissions to it.

Please read below article for more clarification:

Granting access via Azure AD App-Only.

Additional References:

  1. Connect to API secured with Azure Active Directory.
  2. Connect to Azure AD-secured APIs in SharePoint Framework solutions.

Many thanks to @GaneshSanap for providing me a solution. You need to create a self signed cert and upload it to the registered app in AAD. Follow this guide to do so:

Granting access via Azure AD App-Only.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.