gpt4 book ai didi

azure-active-directory - "error_description": "Exception of type ' Microsoft. IdentityModel.Tokens.AudienceUriValidationFailedException ' was thrown."

转载 作者:行者123 更新时间:2023-12-04 14:18:48 25 4
gpt4 key购买 nike

我们正在尝试使用 azure oauth2 安全地访问共享点 api。我们获得了持有者 token ,但是在访问 sharepoint rest api 时,我们得到了状态代码:401 未经授权和响应:{"error_description":"抛出了类型为 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' 的异常。"}

  • 我们已经在 azure AD 中注册了一个客户端应用程序
    一种。在身份验证中定义重定向 uri
    湾将访问角色映射到服务用户帐户
    C。定义的客户端密码
    d.已提供定义的 API 权限和管理员同意

  • token 端点: https://login.microsoftonline.com/66395830-4e70-4a10-8f30-225fe9afd23b/oauth2/v2.0/token

    方法:POST
    机身参数:
    范围: https://66395830-4e70-4a10-8f30-225fe9afd23b.sharepoint.com/.default
    redirect_uri: https://cscglobal.sharepoint.com/teams/uatCLSService/BusinessLicense/KB/_api/Web/lists
    grant_type:client_credentials(注意:我们还尝试通过传递各自的参数来使用 password 和 authorization_code 值)
    客户 secret :XXXXXX
    客户 ID:XXXX

    最佳答案

    我认为您可能以错误的方式设置范围。据我所知,应该是https://yourSite.sharepoint.com/.default或详细范围,如:https://yourSite.sharepoint.com/Sites.ReadWrite.All

    现在建议到use Microsoft Graph API to manage your sharepoint site使用 Microsoft Graph API 来管理您的共享点站点。

    它提供了一个统一的可编程性模型,可用于访问 Office 365、Windows 10 和企业移动性 + 安全性中的大量数据。

    关于azure-active-directory - "error_description": "Exception of type ' Microsoft. IdentityModel.Tokens.AudienceUriValidationFailedException ' was thrown.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57297510/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com