UiPath Documentation
uipath-cli
latest
false
UiPath CLI 用户指南
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

uip 是连接器构建器身份验证

用于使用 Integration Service 连接器构建器配置和检查连接器身份验证方案的语法和选项 — auth set、auth get 和 auth system create/list。

本页介绍 uip is connectors builder auth,该命令组用于定义连接器自身的身份验证方案,即连接器本身如何与其供应商 API 对话。这是一个设计时问题,与租户连接不同,租户连接是该方案的运行时实例(特定用户的凭据与此页面配置的方案的对比)。有关连接器目录解析、设计与已发布的区别以及整体创作流程,请参阅父页面上的概念。

大纲​

uip is connectors builder auth set --auth-type <type> [scheme-specific options] [--connector-dir <path>]
uip is connectors builder auth get [--connector-dir <path>]
uip is connectors builder auth system create --type <type> [--vendor-path <path>] [--method <method>] [--next-resource <selector>] [--path <path>] [--connector-dir <path>]
uip is connectors builder auth system list [--connector-dir <path>]
uip is connectors builder auth set --auth-type <type> [scheme-specific options] [--connector-dir <path>]
uip is connectors builder auth get [--connector-dir <path>]
uip is connectors builder auth system create --type <type> [--vendor-path <path>] [--method <method>] [--next-resource <selector>] [--path <path>] [--connector-dir <path>]
uip is connectors builder auth system list [--connector-dir <path>]

这些选项都不是租户作用域的 — 此组中的任何位置都没有 --tenant 标志。此处的“所有内容”仅编辑或读取本地连接器目录。

uip 是连接器构建器身份验证集​

在连接器上配置身份验证。需要一个 --auth-type;剩余哪个选项适用取决于该类型。对已配置的连接器重新运行将失败,除非传递 --force,这会将差异应用于现有配置条目而不是出错 — 存在这种情况是因为系统可能会拒绝第一次尝试(例如,作用域选项更改与现有配置),并且需要重试。

备注:

使用此选项在现有连接器上为以下任何身份验证类型连接身份验证,或交换现有连接器的身份验证类型 (--force)。通过 --scope-options/--required-scopes/--preselected-scopes 在此处定义 OAuth/JWT 作用域 — 没有单独的 auth scope 命令。不要使用此方法从头开始创建连接器 — 先使用builder init 。不要将其用于非身份验证配置条目 — 使用builder init preset apply或builder state patch (请参阅触发器和状态)。

选项​

长值应用对象描述
--auth-type <type>以下类型之一全部必需。要配置的身份验证流程。
--connector-dir <path>路径全部连接器目录。解决方案顺序与概念图相同。
--force标记全部在配置连接器时,将差异应用于现有配置条目,而不是出错。
--authorization-url <url>urlOAuth登录/同意 URL。
--token-url <url>urlOAuth、JWT令牌端点。
--token-refresh-url <url>urlOAuth默认为 --token-url。
--token-revoke-url <url>urlOAuth令牌撤销端点。
--scope <scope>字符串OAuth、JWT、 firstPartyService以空格分隔的作用域字符串。firstPartyService 为塑造的令牌包含的平台作用域。
--jwt-claim <spec>name[=value][;label=...][;hint=...]、可重复jwtOauth, jwtOauth2JWT 断言声明。创建必填名称(无 =value),以便连接用户在连接时填写该名称; label/hint 设置连接表单显示名称和提示文本。
--jwt-header <spec>与 --jwt-claim 相同的语法,可重复jwtOauth, jwtOauth2JWT 断言标头。
--aws-service-name <name>字符串awsv4SigV4 服务名称常量(例如 polly、connect);设置隐藏的 aws.service.name 默认值。
--scope-options <json>以下内容的 JSON 数组 {description, value}OAuth、JWT多选为连接用户提供的作用域选项。
--scope-options-file <path>路径OAuth、JWT从文件中读取 --scope-options JSON,而不是内联。
--required-scopes <csv>逗号分隔OAuth、JWT用户无法取消选择的作用域。
--preselected-scopes <csv>逗号分隔OAuth、JWT默认情况下预先检查作用域。
--scope-delimiter <char>字符串OAuth、JWT作用域分隔符。默认值: Space。
--scope-hint-text <text>字符串OAuth、JWT显示在作用域选取器下的提示文本。
--scope-screen-type <type>字符串OAuth、JWTconfigScreenType 用于输入作用域。默认值:pre。
--api-key-param-name <name>字符串customApiKey必需的供应商标头或查询参数名称。
--api-key-location <where>header | querycustomApiKey密钥发送位置。默认值:header。
--api-key-prefix <prefix>字符串customApiKey附加到键值的文字前缀。
--key-config-name <key>字符串customApiKey内部配置密钥。默认值:custom.api.key。
--key-config-display-name <name>字符串customApiKey用户界面标签。默认值:API Key。
--validation-vendor-path <path>路径全部(可选)在此供应商路径中添加 provisionAuthValidation 测试调用。
--validation-method <method>HTTP 方法全部(可选)用于 auth-validation 调用的方法。默认和推荐值:GET — 探测器必须为只读,并且不得更改供应商数据。
--auth-header <kv>ConfigName=VendorHeader、可重复多标头方案额外静态身份验证标头,以纯文本配置形式创建,由连接用户填写。适用于需要多个凭据标头的方案(例如 iContact 的 API-AppId/API-Username)。
--secret-auth-header <kv>ConfigName=VendorHeader、可重复多标头方案与 --auth-header 类似,但配置将创建为加密密码字段。适用于凭据标头,例如 API-Password。

--auth-type 接受以下选项之一:oauth2、oauth2Pkce、oauth2ClientCredentials、oauth2Password、oauth2PrivateKeyJwt、oauth1、basic、jwtOauth、jwtOauth2、custom、customApiKey 、personalAccessToken、awsv4、googleServiceAccount、rsaCertificate、none、firstPartyService、fpsUserDelegatedAccess、fpsRobotAccess。

firstPartyService是 UiPath 平台注入身份:平台创建并刷新令牌,将{host} / {account} / {tenant}绑定到平台标头,而不是连接时配置字段(这三个字段实际上已从配置文件中删除)集将切换到此类型,如下面的示例所示)。

每种身份验证类型都会写入不同的配置捆绑包——下面的每个示例都显示了特定于类型的真实结果,而不是一个通用形状。

示例​

# OAuth2 authorization-code flow
uip is connectors builder auth set --auth-type oauth2 \
  --authorization-url https://acme.com/oauth/authorize \
  --token-url https://acme.com/oauth/token \
  --scope 'read write'
# OAuth2 authorization-code flow
uip is connectors builder auth set --auth-type oauth2 \
  --authorization-url https://acme.com/oauth/authorize \
  --token-url https://acme.com/oauth/token \
  --scope 'read write'
{
  "Code": "AuthConfigured",
  "Data": {
    "AuthType": "oauth2",
    "AuthenticationTypes": ["oauth2"],
    "TypeOauth": true,
    "OauthRefreshResourceCreated": true,
    "ConfigChanges": {
      "added": ["oauth.api.key", "oauth.api.secret", "oauth.token.url"],
      "updated": [],
      "unchanged": []
    }
  }
}
{
  "Code": "AuthConfigured",
  "Data": {
    "AuthType": "oauth2",
    "AuthenticationTypes": ["oauth2"],
    "TypeOauth": true,
    "OauthRefreshResourceCreated": true,
    "ConfigChanges": {
      "added": ["oauth.api.key", "oauth.api.secret", "oauth.token.url"],
      "updated": [],
      "unchanged": []
    }
  }
}
# customApiKey, sent as a header
uip is connectors builder auth set --auth-type customApiKey --api-key-param-name X-API-Key
# customApiKey, sent as a header
uip is connectors builder auth set --auth-type customApiKey --api-key-param-name X-API-Key
{
  "Code": "AuthConfigured",
  "Data": {
    "AuthType": "customApiKey",
    "AuthenticationTypes": ["customApiKey"],
    "TypeOauth": false,
    "ApiKeyConfigAdded": true,
    "ApiKeyParamAdded": true,
    "KeyConfigName": "custom.api.key",
    "ConfigChanges": { "added": ["custom.api.key"], "updated": [], "unchanged": [] }
  }
}
{
  "Code": "AuthConfigured",
  "Data": {
    "AuthType": "customApiKey",
    "AuthenticationTypes": ["customApiKey"],
    "TypeOauth": false,
    "ApiKeyConfigAdded": true,
    "ApiKeyParamAdded": true,
    "KeyConfigName": "custom.api.key",
    "ConfigChanges": { "added": ["custom.api.key"], "updated": [], "unchanged": [] }
  }
}
# Re-apply a config diff that was rejected on first try
uip is connectors builder auth set --auth-type customApiKey --api-key-param-name X-API-Key --force
# Re-apply a config diff that was rejected on first try
uip is connectors builder auth set --auth-type customApiKey --api-key-param-name X-API-Key --force
{
  "Code": "AuthConfigured",
  "Data": {
    "AuthType": "customApiKey",
    "ConfigChanges": {
      "added": [],
      "updated": [{ "key": "custom.api.key", "diff": { "displayOrder": [3, 1] } }],
      "unchanged": []
    }
  }
}
{
  "Code": "AuthConfigured",
  "Data": {
    "AuthType": "customApiKey",
    "ConfigChanges": {
      "added": [],
      "updated": [{ "key": "custom.api.key", "diff": { "displayOrder": [3, 1] } }],
      "unchanged": []
    }
  }
}
# OAuth 2.0 JWT Bearer (Salesforce-style): claims with a value are pre-filled,
# bare claims are filled in by the connection user
uip is connectors builder auth set --auth-type jwtOauth \
  --token-url https://login.salesforce.com/services/oauth2/token \
  --jwt-claim aud=https://login.salesforce.com \
  --jwt-claim iss \
  --jwt-claim sub
# OAuth 2.0 JWT Bearer (Salesforce-style): claims with a value are pre-filled,
# bare claims are filled in by the connection user
uip is connectors builder auth set --auth-type jwtOauth \
  --token-url https://login.salesforce.com/services/oauth2/token \
  --jwt-claim aud=https://login.salesforce.com \
  --jwt-claim iss \
  --jwt-claim sub
{
  "Code": "AuthConfigured",
  "Data": {
    "AuthType": "jwtOauth",
    "AuthenticationTypes": ["jwtOauth"],
    "TypeOauth": true,
    "ConfigChanges": {
      "added": [
        "oauth.api.key", "oauth.api.secret", "oauth.callback.url", "oauth.token.url",
        "jwt.base64.encoded.key", "jwt.claim.aud", "jwt.claim.iss", "jwt.claim.sub"
      ],
      "updated": [],
      "unchanged": []
    }
  }
}
{
  "Code": "AuthConfigured",
  "Data": {
    "AuthType": "jwtOauth",
    "AuthenticationTypes": ["jwtOauth"],
    "TypeOauth": true,
    "ConfigChanges": {
      "added": [
        "oauth.api.key", "oauth.api.secret", "oauth.callback.url", "oauth.token.url",
        "jwt.base64.encoded.key", "jwt.claim.aud", "jwt.claim.iss", "jwt.claim.sub"
      ],
      "updated": [],
      "unchanged": []
    }
  }
}
# UiPath first-party service auth (platform-injected identity)
uip is connectors builder auth set --auth-type firstPartyService --scope OrchestratorApiUserAccess
# UiPath first-party service auth (platform-injected identity)
uip is connectors builder auth set --auth-type firstPartyService --scope OrchestratorApiUserAccess
{
  "Code": "AuthConfigured",
  "Data": {
    "AuthType": "firstPartyService",
    "AuthenticationTypes": ["firstPartyService"],
    "TypeOauth": false,
    "ConfigChanges": {
      "added": [
        "oauth.scope", "oauth.basic.header", "oauth.user.token",
        "oauth.user.refresh_time", "oauth.user.refresh_interval"
      ],
      "updated": [],
      "unchanged": [],
      "removed": ["host", "account", "tenant"]
    }
  }
}
{
  "Code": "AuthConfigured",
  "Data": {
    "AuthType": "firstPartyService",
    "AuthenticationTypes": ["firstPartyService"],
    "TypeOauth": false,
    "ConfigChanges": {
      "added": [
        "oauth.scope", "oauth.basic.header", "oauth.user.token",
        "oauth.user.refresh_time", "oauth.user.refresh_interval"
      ],
      "updated": [],
      "unchanged": [],
      "removed": ["host", "account", "tenant"]
    }
  }
}
# No authentication
uip is connectors builder auth set --auth-type none
# No authentication
uip is connectors builder auth set --auth-type none
{
  "Code": "AuthConfigured",
  "Data": {
    "AuthType": "none",
    "AuthenticationTypes": ["none"],
    "TypeOauth": false,
    "ConfigChanges": { "added": [], "updated": [], "unchanged": [] }
  }
}
{
  "Code": "AuthConfigured",
  "Data": {
    "AuthType": "none",
    "AuthenticationTypes": ["none"],
    "TypeOauth": false,
    "ConfigChanges": { "added": [], "updated": [], "unchanged": [] }
  }
}

uip 是连接器构建器身份验证获取​

读取连接器的完整身份验证设置:类型、配置条目(已编辑的密码)、生命周期资源和 FPS 标头绑定。

备注:

使用此方法来检查连接器的当前身份验证块。要更改它,请使用 auth set。

选项​

长值描述
--connector-dir <path>路径连接器目录。解决方案顺序与概念图相同。

示例​

uip is connectors builder auth get
uip is connectors builder auth get

数据形状(--输出 json)​

{
  "Code": "AuthInfo",
  "Data": {
    "ConnectorRoot": "/work/my-acme-connector",
    "Authentication": {
      "Type": "jwtOauth",
      "AuthenticationTypes": ["jwtOauth"],
      "TypeOauth": true
    },
    "Configs": [
      {
        "key": "oauth.token.url",
        "configScreenType": null,
        "required": true,
        "hidden": true,
        "defaultValue": "https://login.acme.com/oauth2/token"
      },
      {
        "key": "jwt.claim.iss",
        "configScreenType": "pre",
        "required": true,
        "defaultValue": null
      }
    ],
    "ConnectionFormFields": [],
    "Resources": {
      "oauthOnTokenRefresh": false,
      "provisionAuthValidation": true
    },
    "FpsBindings": null,
    "TemplateBindings": null
  }
}
{
  "Code": "AuthInfo",
  "Data": {
    "ConnectorRoot": "/work/my-acme-connector",
    "Authentication": {
      "Type": "jwtOauth",
      "AuthenticationTypes": ["jwtOauth"],
      "TypeOauth": true
    },
    "Configs": [
      {
        "key": "oauth.token.url",
        "configScreenType": null,
        "required": true,
        "hidden": true,
        "defaultValue": "https://login.acme.com/oauth2/token"
      },
      {
        "key": "jwt.claim.iss",
        "configScreenType": "pre",
        "required": true,
        "defaultValue": null
      }
    ],
    "ConnectionFormFields": [],
    "Resources": {
      "oauthOnTokenRefresh": false,
      "provisionAuthValidation": true
    },
    "FpsBindings": null,
    "TemplateBindings": null
  }
}

从不包含输入密码的配置值(密码、API 密钥),仅包含配置的元数据(键,可以是必填/隐藏,默认是非机密信息)。

uip 是连接器构建器身份验证系统​

管理连接器生命周期(“系统”)资源 — 身份验证时挂钩,例如 provisionAuthValidation、onProvision 和 oauthOnTokenRefresh。这些端点位于auth下,因为它们是身份验证生命周期挂钩:没有单独的 SR(语义资源)文件的元素.json 条目,与activity create创建的普通 API 端点(或通过activity create --skip-sr — 请参阅活动和挂钩)。

uip 是身份验证系统创建的连接器构建器​

备注:

使用此选项连接生命周期挂钩端点 - auth-validation、onProvision 或令牌刷新调用。请勿使用此选项来添加普通 API 端点 — 改为使用 builder activity create。

选项​
长值描述
--type <type>字符串必需。系统资源类型,例如 provisionAuthValidation、onProvision、oauthOnTokenRefresh。
--vendor-path <path>路径此挂钩的供应商 API 路径。
--method <method>HTTP 方法当类型需要方法时,默认为 POST。
--next-resource <selector>METHOD:/path链接到下一个资源,例如 GET:/organization。
--path <path>路径显式资源路径 — 当类型声明类型时,必须与该类型的覆盖路径匹配。
--connector-dir <path>路径连接器目录。解决方案顺序与概念图相同。
示例​
uip is connectors builder auth system create --type provisionAuthValidation --vendor-path /me
uip is connectors builder auth system create --type provisionAuthValidation --vendor-path /me
数据形状(--输出 json)​
{
  "Code": "SystemResourceCreated",
  "Data": {
    "ResourceName": "provisionAuthValidation",
    "ConnectorRoot": "/work/my-acme-connector",
    "ResourceType": "provisionAuthValidation",
    "ElementEntriesAdded": ["provisionAuthValidation"],
    "ElementEntriesSkipped": [],
    "SkipSr": true
  }
}
{
  "Code": "SystemResourceCreated",
  "Data": {
    "ResourceName": "provisionAuthValidation",
    "ConnectorRoot": "/work/my-acme-connector",
    "ResourceType": "provisionAuthValidation",
    "ElementEntriesAdded": ["provisionAuthValidation"],
    "ElementEntriesSkipped": [],
    "SkipSr": true
  }
}

uip 是连接器构建器身份验证系统列表​

列出类型为系统资源的连接器的element.json 条目。

选项​
长值描述
--connector-dir <path>路径连接器目录。解决方案顺序与概念图相同。
示例​
uip is connectors builder auth system list
uip is connectors builder auth system list
数据形状(--输出 json)​
{
  "Code": "SystemResourceList",
  "Data": {
    "Resources": [
      { "name": "provisionAuthValidation", "type": "provisionAuthValidation" }
    ]
  }
}
{
  "Code": "SystemResourceList",
  "Data": {
    "Resources": [
      { "name": "provisionAuthValidation", "type": "provisionAuthValidation" }
    ]
  }
}

另请参阅​

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新