【发布时间】:2020-09-18 08:41:29
【问题描述】:
【问题讨论】:
标签: azure-devops azure-devops-rest-api azure-devops-extensions
【问题讨论】:
标签: azure-devops azure-devops-rest-api azure-devops-extensions
有没有办法通过 API 了解 3rd 的组织政策是什么 参与方 OAuth 请求?
您可以使用我从 F12 获取的这个 api:
Get https://dev.azure.com/{YourOrgName}/_settings/organizationPolicy?__rt=fps&__ver=2
响应将包含有关 Application Connection Policies 的信息:
"ms.vss-admin-web.organization-policies-data-provider": {
"policies": {
"applicationConnection": [
{
"policy": {
"name": "Policy.DisallowOAuthAuthentication",
"value": false,
"effectiveValue": true,
"parentPolicy": {
"name": "Policy.DisallowOAuthAuthentication",
"value": false,
"effectiveValue": true,
"isValueUndefined": true
}
},
"learnMoreLink": "https://aka.ms/vstspolicyoauth",
"description": "Third-party application access via OAuth",
"applicableServiceHost": 1
},
{
"policy": {
"name": "Policy.DisallowSecureShell",
"value": false,
"effectiveValue": true,
"isValueUndefined": true,
"parentPolicy": {
"name": "Policy.DisallowSecureShell",
"value": false,
"effectiveValue": true,
"isValueUndefined": true
}
},
"learnMoreLink": "https://aka.ms/vstspolicyssh",
"description": "SSH authentication",
"applicableServiceHost": 1
}
]...
对应的policy 节点下的effectiveValue(不是value 节点)节点应该代表您是否在图片中启用/禁用上述策略。例如:如果Third-party application access via OAuth 被禁用,则第一个policy 节点下的effectiveValue 节点将为false。
【讨论】: