在线Sharepoint“不支持的应用专用令牌". [英] Sharepoint online 'Unsupported app only token.'
问题描述
我通过调用范围为 https://{的https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
来获得承载令牌.tenantName} .sharepoint.com/.default
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
这是Azure AD中已注册应用程序的令牌.
It's a token for a registered app in Azure AD.
当我使用该令牌进行API调用时,例如 https://infoinnobake.sharepoint.com/_api/search/query?querytext='contentclass:STS_Site contentclass:SP.Webb'& selectproperties ='标题,路径'& rowlimit = 500
我只发布 401不支持的仅应用令牌.
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.
可以解释一下原因吗?是否可以通过Azure AD上已注册的应用程序访问sharepoint在线API?
can some explain why? Is it possible to access the sharepoint online API with an registered App on Azure AD?
推荐答案
在此处遵循此指南: https://docs.microsoft.com/zh-CN/sharepoint/dev/solution-guidance/security-apponly-azuread
您需要创建证书并将证书上传到注册的应用程序.比起您可以使用各种编程语言使用API或SharepointClient
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
这篇关于在线Sharepoint“不支持的应用专用令牌".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!