You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Bearer Token调用Azure DevOps REST API列出PAT时遇203错误求助

解决Azure DevOps PAT令牌列表API的203 Non-Authoritative Information错误
  • 错误根源:生成Bearer Token时指定的resource参数错误。你当前使用的https://management.azure.com/是Azure管理API的资源标识,但调用Azure DevOps令牌API需要指向Azure DevOps专属的资源,正确的资源值应为https://dev.azure.com/(若针对特定组织,也可使用https://<你的组织名>.visualstudio.com/)。

  • 修正后的Token请求:
    将POST请求中的resource字段替换为正确值,示例如下:

    POST https://login.microsoftonline.com/<tenantID>/oauth2/token
    grant_type:client_credentials
    client_id: <appID>
    client_secret: <secret>
    resource: https://dev.azure.com/
    
  • 额外配置要求:

    • 确保你的服务主体(即client_id对应的应用)在目标Azure DevOps组织中被授予**Token Management (Read)**权限,可通过组织设置的“权限”页面完成配置。
    • 调用PAT列表API时,需使用正确的请求格式:
      GET https://vssps.dev.azure.com/{organization}/_apis/tokens/pats?api-version=7.0
      Authorization: Bearer <修正后的令牌>
      

内容的提问来源于stack exchange,提问作者Uday Kiran

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.26 17:12:04