使用AAD访问令牌的Sharepoint REST api访问失败并出现AudienceUriValidationFailedException [英] Sharepoint REST api access using AAD access token failing with AudienceUriValidationFailedException
问题描述
我们正在尝试使用共享密钥方法使用Azure Active Directory中的服务到服务连接方法访问Sharepoint数据:
We are attempting to access Sharepoint data using the service to service connection method in Azure Active Directory with the shared secret method:
https://docs.microsoft.com/zh-CN/azure/active-directory/develop/active-directory-protocols-oauth-service-to-service
https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-service-to-service
上述文档中概述的所有步骤都可以正常工作.我们有一个访问令牌,并且Azure内已注册的应用程序已被授予Office 365 SharePoint Online的应用程序权限.
All of the steps outlined in the above documentation are working fine. We have an access token, and the registered app inside Azure has been granted application permissions to Office 365 SharePoint Online.
当我们向任何Sharepoint REST api端点发送请求时,访问令牌正在工作,因为在获得优质令牌之前,我们将获得未授权的错误.但是,对于每个请求,我们总是会返回以下错误:
When we send a request to any of the Sharepoint REST api endpoints, the access token is working because prior to getting good tokens we would get not authorized errors. However, on every request we always get back the following error:
{"error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."}
我们缺少什么?
推荐答案
请尝试使用Fiddler监视请求和响应,并提供有关该错误的更多信息.
Please try to use Fiddler to monitor the requests and responses, and provider more information about the error.
https://www.telerik.com/fiddler
并检查具有以下类似错误的线程:
And check the thread with similar error as below:
最好的问候,
丹尼斯
这篇关于使用AAD访问令牌的Sharepoint REST api访问失败并出现AudienceUriValidationFailedException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!