订阅

UiPath Installation and Upgrade

UiPath 安装和升级指南

Identity Server AppSettings.json

appsettings.json 文件 (C:\Program Files (x86)\UiPath\Orchestrator\Identity) 包含身份服务器的开箱即用配置设置。第二个相同的文件 appsettings.Production.json 包含您的特定身份服务器设置。

🚧

重要

要根据需要配置标识服务器,应修改 appsettings.Production.json 文件。每次安装完成后,此文件将覆盖 appsettings.json 中预先存在的任何设置。

📘

备注:

It is recommended that only administrators change the values of these parameters.

此外,建议您关闭 IIS 服务器,以便在任何情况下修改 appsettings.Production.json 设置。

未记录在此页中的参数不应更改。

所有参数都区分大小写

设置优先级

可以在多个位置配置设置。以下是身份服务器在确定设置的值时使用的优先级,从高 (1) 到低 (3):

  1. appsettings.Production.json 文件中的值
  2. appsettings.json 文件中的值
  3. 代码中的默认值设置。仅当在 appsettings.Production.jsonappsettings.json 中找不到特定设置时使用。

设置

文件 appsettings.json 的内部结构由多个 json 部分组成,用逗号分隔。

连接字符串

ConnectionStrings 部分用于存储身份服务器数据库连接字符串。此值由安装程序填充。
此设置具有 appsettings.Production.jsonappsettings.json 中的值。

"ConnectionStrings": {
  "DefaultConnection": "Server=.\\sqlexpress;Database=IdentityServer;User ID=<username>;Password=<password>;"
}

加密方式

The EncryptionSettings section is used to store tenant encryption keys. The values are automatically migrated from Orchestrator's UiPath.Orchestrator.dll.config during installation.
此设置具有 appsettings.Production.jsonappsettings.json 中的值。

"EncryptionSettings": {
  "EncryptionKey": "3wkO1hkaXLwR9LZoRZIueIxG3GIEB/YMDZUWhD9AR8g="
}

可以将身份服务器配置为使用本地密钥(见上文)或 Azure 密钥保管库(见下文),就像 Orchestrator 一样。

"EncryptionSettings": {
  "MultiTenantEncryptionKeyProvider": "AzureKeyVault",
  "EncryptionKeyPerTenant": true,
  "AzureKeyVaultAddress": "keyVaultAddress",
  "AzureKeyVaultCertificateThumbprint": "keyvaultCertificateThumbprint",
  "AzureKeyVaultClientId" : "azureClientId"
},
  • MultiTenantEncryptionKeyProvider - 指示在哪个密钥管理应用程序中存储从 Orchestrator 生成的每个租户的加密密钥。默认情况下,该设置在代码中具有 ConfigFileKey 值。接受的值是 AzureKeyVaultConfigFileKey。在 Identity Server 安装期间,该值将从 UiPath.Orchestrator.dll.config 的 EncryptionKeyPerTenant.KeyProvider 设置中复制。

以下身份服务器密钥与 UiPath.Orchestrator.dll.config安全应用程序设置部分中的 Orchestrator 密钥匹配:

Identity Server KeyOrchestrator Key
EncryptionKeyPerTenantEncryptionKeyPerTenant.Enabled
AzureKeyVaultAddressAzure.KeyVault.VaultAddress
AzureKeyVaultCertificateThumbprintAzure.KeyVault.CertificateThumbprint
AzureKeyVaultClientIdAzure.KeyVault.ClientId
AzureKeyVaultDirectoryIdAzure.KeyVault.DirectoryId
MultiTenantEncryptionKeyProviderEncryptionKeyPerTenant.KeyProvider

🚧

重要

如果 CertificatesStoreLocation 中的参数 UiPath.Orchestrator.dll.config 设定为 LocalMachine,请确保 AzureKeyVaultCertificateStoreLocationappsettings.Production.json 中具有相同的值。

🚧

重要

如果在 Orchestrator 的 UiPath.Orchestrator.dll.config 内更改加密密钥Azure 密钥保管库设置,则还须使用相同的值更新身份服务器的 appsettings.Production.json

Logging

The Logging section configures the log level for each component used by Identity Server. This is a generic logging configuration. Find more information here.
此部分具有 appsettings.json 中的值。

"Logging": {
  "LogLevel": {
    "Default": "Trace",
    "Microsoft": "Warning",
    "Microsoft.Hosting.Lifetime": "Information"
  }
}

身份服务器为一些主要组件(如 MicrosoftMicrosoft.Hosting.Lifetime)提供一些默认值。

NLog

NLog 部分用于定义如何通过 NLog 目标在身份服务器中记录信息,就像在 Orchestrator 中一样。
此部分具有 appsettings.json 中的值。

"NLog": {
  "IncludeScopes": true,
  "throwConfigExceptions": false,
  "targets": {
    "EventLog": {
      "type": "EventLog",
      "source": "IdentityService",
      "layout": "${longdate} ${logger} ${message}${onexception:${newline}${exception:maxInnerExceptionLevel=10:format=shortType,message,stacktrace:separator=*:innerExceptionSeparator=&#xD;&#xA;&#x9;}}"
    }
  },
  "rules": [
    {
      "logger": "*",
      "minLevel": "Info",
      "writeTo": "EventLog"
    }
  ]
},

默认情况下,NLog 配置为将日志写入应用程序事件。在此处阅读更多有关如何使用 json 部分配置 NLog 的信息。

App Settings

AppSettings 部分是身份服务器的主配置部分。此部分具有 appsettings.Production.jsonappsettings.json 中的值。

  • IdentityServerAddress - 表示身份服务器在验证用于调用身份服务器 API 的令牌时检查的受众。在安装过程中,此字段会自动将身份服务器的地址填充到 appsettings.Production.json不要修改此值,因为它将中断 Orchestrator 数据传播。
    此设置具有 appsettings.Production.jsonappsettings.json 中的值。

📘

备注:

确保提供小写 URL 作为 IdentityServerAddress 的值;否则,将发生错误。

  • Saml2ValidCertificateOnly - 如果设置为 true,则在配置 SAML2 时不允许使用无效证书。
    默认情况下,该设置在代码中具有 true 值。
  • EnablePII - 当设置为 true 时,异常包含敏感信息(例如,外部身份提供程序的 URL 地址或身份服务器的地址等)。
    默认情况下,该设置在 appsettings.json 和代码中具有 false 值。
  • HideErrorCodesInUi - 控制是否在 UI 中显示登录错误代码。默认情况下不显示此参数。默认值为 false。将其设置为 true 可以隐藏 UI 中的登录错误代码。例如,"HideErrorCodesInUi": true
  • CookieValidationInterval - 表示时间间隔(以秒为单位),此时间段过后将检查 Cookie,以确定用户和租户是否仍处于活动状态,以及用户是否尚未登录其他浏览器。appsetttings.Production.json 中的值会自动从具有相同设置的 Orchestrator 中迁移。
    默认情况下,该值在 appsettings.Production.json 和代码内设置为60 秒。
  • CookieExpireMinutes - 表示身份服务器 Cookie 过期前的时间间隔(以分钟为单位)。appsetttings.Production.json 中的值从具有相同设置的 Orchestrator 自动迁移。
    默认情况下,该值在 appsettings.Production.json 和代码内设置为 60 分钟。
  • UseRedisStoreCache - 将其值设置为 true 以启用 OAuth 客户端数据的 Redis 缓存。使用交互式登录在短时间内连接大量机器人时,这有助于防止出现性能问题。此缓存使用 LoadBalancerSettings 中指定的相同 Redis 连接字符串。默认情况下,UseRedisStoreCache 设置不会显示。
    注意:如果您使用外部应用程序功能,则不建议这样做,因为此设置将缓存客户端,并且不会反映对外部应用程序的更新。
  • OrchestratorUrl - Represents the URL of the Orchestrator. This is where Identity Server redirects you when you click the Orchestrator icon within Identity Management Portal's Hub menu.
    该值在安装过程中在 appsettings.Production.json 中设置。

📘

备注:

确保提供小写 URL 作为 OrchestratorUrl 的值;否则,将发生错误。

"AppSettings": {
    "IdentityServerAddress": "https://myIdentity.domain.local/identity",
    "EnablePII": false,
    "HideErrorCodesInUi": true,
    "CookieExpireMinutes": 30,
    "OrchestratorUrl": "https://myOrchestratorURL.domain.local"
  }
}

本地化

LocalizationSettings 部分在代码中具有以下默认值:

"LocalizationSettings": {
  "EnabledLanguages": "en,ja,de,es,es-MX,fr,ko,pt,pt-BR,ru,tr,zh-CN"
}
  • EnabledLanguages - 列出身份服务器中可用的语言。它用于限制可用语言的数量。

Load Balancer

LoadBalancerSettings 部分在 appsettings.Production.json 和代码中具有以下默认值:

"LoadBalancerSettings": {
  "UseRedis": false,
  "RedisConnectionString": "",
  "SlidingExpirationTimeInSeconds":  600
}

在多节点升级情况下,appsetttings.Production.json 中的值会自动从 Orchestrator 的 UiPath.Orchestrator.dll.config 中迁移。如果未在 Orchestrator 中配置 Redis,appsettings.Production.json 将包含此设置。

  • UseRedis - 使用 Redis 作为数据库,将消息和缓存在通过负载均衡器连接的所有计算机之间分发。这对多节点来说是必需的。
  • RedisConnectionString - Can only be used if LoadBalancer.UseRedis is set to true. A connection string that enables you to set up your Redis server, which contains the URL of the server, the password, and port used with Redis. It is also possible to enable SSL encrypted connections between the Orchestrator nodes and the Redis service. For more information, please click here. Examples:
    • 启用 SSL - "RedisConnectionString": "DOCWREDIS02:6379,password=12345678,ssl=true"
    • 未启用 SSL - "RedisConnectionString": "DOCWREDIS02:6379,password=12345678"
  • SlidingExpirationTimeInSeconds - 控制缓存内项目的可调过期时间。此过期时间适用于 Redis 缓存和 InMemory 缓存(当 Redis 不可用时,这是默认值)。

签名凭据

SigningCredentialSettings 部分描述用于对身份服务器生成的令牌进行签名的证书的位置。此部分中的设置值由安装程序根据您的输入填充。可以配置这些设置,以便从证书存储区或 Azure 密钥保管库中读取证书。

证书轮换设置

  • ValidationKeys - 用于指示第二个证书的 NameLocationNameType。这是证书轮换的必要操作。

📘

备注:

出于安全原因,签名证书必须具有 2048 位公钥。确保证书有效、未过期,并且Identity Server 可以访问私钥。
有关您需要对 SigningCredentialSettings 部分做出的调整,请参阅证书轮换了解详情,以确保您始终在证书有效期内使用证书。

证书存储位置设置示例

下面是在证书存储区内查找证书的传统配置:

"SigningCredentialSettings": {
  "StoreLocation": {
    "Name": "30f3c11e676fc8eb1f9dd4e330f3ce668d796796",
    "Location": "LocalMachine",
    "NameType": "Thumbprint"
  }

此示例中,Name 表示指纹值。
我们不建议为 LocationNameType 使用其他值。

Azure 密钥保管库位置设置示例

"SigningCredentialSettings": {
  "AzureKeyVaultLocation": {
    "KeyName": "key_name_534553553"
  }

在此示例中,KeyName 表示要在 Azure 密钥保管库内搜索的密钥。

Authorization

  • RestrictBasicAuthentication - 允许您配置用户是否可以使用基本身份验证凭据登录 Orchestrator 实例。默认情况下,此设置不会显示在 appsettings.Production.json 中。以下值可用:

    • true - 用户无法使用基本身份验证凭据登录。
    • false - 用户无法使用基本身份验证凭据登录。这是默认值。
  • EnableBasicAuthenticationForHostTenant - 允许您配置主机管理员是否可以使用基本身份验证凭据登录 Orchestrator 实例的主机租户。此设置在 appsettings.Production.json 文件中默认不显示。以下值可用:

    • true - 主机管理员无法使用基本身份验证凭据登录。这是默认值。
    • false - 主机管理员无法使用基本身份验证凭据登录。

此参数绕过 RestrictBasicAuthentication 参数,这意味着如果将 EnableBasicAuthenticationForHostTenant 设置为 true,并且将 RestrictBasicAuthentication 设置为 true,则只能在主机级别使用基本身份验证凭据登录。

约一个月前更新


Identity Server AppSettings.json


建议的编辑仅限用于 API 参考页面

您只能建议对 Markdown 正文内容进行编辑,而不能建议对 API 规范进行编辑。