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

正在验证身份

API 身份验证可确保只有授权方才能与可用资源进行交互并执行必要的操作。UiPath 为不同场景提供了多种身份验证方法。

通过持有者令牌进行本地用户身份验证(ROPC 身份验证)

重要提示:

We support authentication through ROPC for backwards compatibility for Orchestrator instances that have been migrated from standalone to Automation Suite deployments.Only Host administrators should authenticate using the /api/account/authenticate/ endpoint.Business users should authenticate using External Applications.

资源所有者密码凭据身份验证方法是租户作用域,因此外部应用程序将无法使用此方法进行身份验证,因为无法在租户级别创建外部应用程序。

  1. 要检索访问令牌,请使用以下负载向 {OrchestratorURL}/api/account/authenticate 端点发出 POST 请求:

    {
        "TenancyName": "{account_tenancy_name}",
        "UsernameOrEmailAddress": "{account_username}",
        "Password": "{account_password}"
    }
    {
        "TenancyName": "{account_tenancy_name}",
        "UsernameOrEmailAddress": "{account_username}",
        "Password": "{account_password}"
    }
    

    在上述请求中:

    • {account_tenancy_name}- 是您的 Automation Suite 帐户中的租户唯一标识符
    • {account_username}- 是您的 Automation Suite 帐户的用户名
    • {account_password}- 是用于登录 Automation Suite 帐户的密码
  2. 要查找 Orchestrator 实例的 TenancyName 值,请向 /odata/Users/UiPath.Server.Configuration.OData.GetCurrentUser 端点发出 GET 请求。

    响应正文返回持有者令牌,您的应用程序使用该令牌来授权进一步的 API 调用。 因此,在 API 调用的“授权”标头中,附加 Bearer xxxx 并将 xxxx 替换为 {access_token} 值(例如 Authorization: Bearer eyJhbG ... LnVxjA)。

    {
        "result": "{access_token}",
        "targetUrl": null,
        "success": true,
        "error": null,
        "unAuthorizedRequest": false,
        "__abp": true
    }
    {
        "result": "{access_token}",
        "targetUrl": null,
        "success": true,
        "error": null,
        "unAuthorizedRequest": false,
        "__abp": true
    }
    

    默认情况下,访问令牌的有效期为 30 分钟。 要生成新端点,请再次调用 api/account/authenticate 端点。

    重要提示:

    If your organization uses the Azure Active Directory model, you must register external applications in Orchestrator and use the OAuth flow.

访问 Swagger

如果您使用 Swagger 试用我们的 API,只需在单独的选项卡中登录 Orchestrator 实例即可。

The Orchestrator API Swagger definition can be accessed by adding the /swagger/ui/index#/ suffix to your Orchestrator URL. For example, https://{yourDomain} /swagger/ui/index#/.

备注:

The Swagger authentication expires according to the parameters set in your Orchestrator instance. By default, it is set to 30 minutes. You can change it by modifying the value of the Auth.Cookie.Expire parameter, in the Web.config file.

域用户身份验证

重要提示:

API access with Windows Auto-logon (NTLM authentication) has been removed, as indicated in the deprecation timeline.

我们建议您改用 OAuth 流程,这需要在 Orchestrator 中注册外部应用程序。

如果外部应用程序已注册,请参阅。

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新