3

我正在尝试通过将用户名和密码作为参数传递来通过 VSTS 服务端点生成访问令牌。

令牌是通过 Azure AD 生成的。

我已经编写了一个 c# 方法来创建令牌并且令牌正在成功生成,而我不知道如何从 vsts 扩展文件(vss-extension.json)调用 c# 方法(dll)所以令牌是在什么时候生成的我在自定义服务端点连接中输入我的用户名和密码。

这是用于创建自定义服务端点的 vss-extension.json 和 VSTS 自定义端点图片。我不知道究竟在哪里以及在此处添加什么将调用我的 C#(.dll) 文件。如果可能的话,是否有任何其他方法可以创建令牌。

"authenticationSchemes": [
      {
        "type": "ms.vss-endpoint.endpoint-auth-scheme-token",

       "headers": [{
            "name": "Authorization",
            "value": "{{ endpoint.apitoken }}"
        }],
        "inputDescriptors": [{
            "id": "apitoken",
    "name": "API Key",
    "description": "API key for connection",
    "inputMode": "textbox",
    "isConfidential": false,
    "validation": {
      "isRequired": true,
      "dataType": "string"
            }
        }]
      },
      {
        "type": "ms.vss-endpoint.endpoint-auth-scheme-basic",
        "inputDescriptors": [
          {
            "id": "username",
            "name": "Username",
            "description": "Username",
            "inputMode": "textbox",
            "validation": {
              "isRequired": false,
              "dataType": "string"
            }
          },
          {
            "id": "password",
            "name": "Password",
            "description": "Password",
            "inputMode": "passwordbox",
            "isConfidential": true,
            "validation": {
              "isRequired": false,
              "dataType": "string"
            }
          }
        ]
      }


    ],

在此处输入图像描述

4

0 回答 0