gpt4 book ai didi

用于创建新 PAT 的 Azure DevOps Rest API

转载 作者:行者123 更新时间:2023-12-02 07:32:52 25 4
gpt4 key购买 nike

无法按照 documentation 使用 Rest API 为特定组织创建新的 PAT 。以下请求抛出 403Forbidden 错误,其中我是组织的所有者并使用具有完全访问权限的 PAT。

POST https://vssps.dev.azure.com/myproject/_apis/tokens/pats?api-version=6.1-preview.1

{
"displayName": "new_token",
"scope": "vso.agentpools_manage",
"validTo": "2021-08-26T03:21:20.576Z",
"allOrgs": false
}

enter image description here

最佳答案

您需要更改为使用Azure AD token

可以引用Manage personal access tokens (PATs) using REST API

With this PAT Lifecycle Management API, we’ve opened up the ability tocreate new PATs and revoke existing PATs. In the wrong hands, this APIcould be used by malicious actors to create multiple entry points intoyour organization’s ADO resources. By enforcing Azure ADauthentication, we hope to have this powerful API be more secureagainst this unauthorized usage.

这意味着为了防止恶意行为者和泄漏信息,Azure AD 的实现提供了针对未经授权的使用的安全保护级别。

关于用于创建新 PAT 的 Azure DevOps Rest API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68539241/

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