Sharepoint online 'Unsupported app only token.'

拈花ヽ惹草 提交于 2021-02-11 15:25:13

问题


I got myself a bearer token by calling https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token with the scope https://{tenantName}.sharepoint.com/.default

It's a token for a registered app in Azure AD.

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?


回答1:


Follow this guide right here: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread

you need to create a certificate and upload the certificate to the registered app. Than you can use the API or the SharepointClient in various programming languages



来源:https://stackoverflow.com/questions/56526581/sharepoint-online-unsupported-app-only-token

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!