- 入门指南
- 要求
- 最佳实践
- 安装
- 正在更新
- 身份服务器
- 对启动错误进行故障排除
Identity Server AppSettings.json
appsettings.json 文件 (C:\Program Files (x86)\UiPath\Orchestrator\Identity) 包含身份服务器的开箱即用配置设置。第二个相同的文件 appsettings.Production.json 包含您的特定身份服务器设置。
要根据需要配置标识服务器,应修改 appsettings.Production.json 文件。每次安装完成后,此文件将覆盖 appsettings.json 中预先存在的任何设置。
建议仅由管理员更改这些参数的值。
此外,建议您关闭 IIS 服务器,以便在任何情况下修改 appsettings.Production.json 设置。
未记录在此页中的参数不应更改。
所有参数都区分大小写。
设置优先级
可以在多个位置配置设置。以下是身份服务器在确定设置的值时使用的优先级,从高 (1) 到低 (3):
appsettings.Production.json文件中的值appsettings.json文件中的值- 代码中的默认值设置。仅当在
appsettings.Production.json或appsettings.json中找不到特定设置时使用。
设置
文件 appsettings.json 的内部结构由多个 json 部分组成,用逗号分隔。
连接字符串
ConnectionStrings 部分用于存储身份服务器数据库连接字符串。此值由安装程序填充。
此设置具有 appsettings.Production.json 和 appsettings.json 中的值。
"ConnectionStrings": { "DefaultConnection": "Server=.\\sqlexpress;Database=IdentityServer;User ID=<username>;Password=<password>;" }
"ConnectionStrings": { "DefaultConnection": "Server=.\\sqlexpress;Database=IdentityServer;User ID=<username>;Password=<password>;" }
加密方式
EncryptionSettings 部分用于存储租户加密密钥。在安装过程中,这些值会自动从 Orchestrator 的 UiPath.Orchestrator.dll.config 迁移。
此设置具有 appsettings.Production.json 和 appsettings.json 中的值。
"EncryptionSettings": {
"EncryptionKey": "<your-encryption-key>"
}
"EncryptionSettings": {
"EncryptionKey": "<your-encryption-key>"
}
可以将身份服务器配置为使用本地密钥(见上文)或 Azure 密钥保管库(见下文),就像 Orchestrator 一样。
"EncryptionSettings": {
"MultiTenantEncryptionKeyProvider": "AzureKeyVault",
"EncryptionKeyPerTenant": true,
"AzureKeyVaultAddress": "keyVaultAddress",
"AzureKeyVaultCertificateThumbprint": "keyvaultCertificateThumbprint",
"AzureKeyVaultClientId" : "azureClientId"
},
"EncryptionSettings": {
"MultiTenantEncryptionKeyProvider": "AzureKeyVault",
"EncryptionKeyPerTenant": true,
"AzureKeyVaultAddress": "keyVaultAddress",
"AzureKeyVaultCertificateThumbprint": "keyvaultCertificateThumbprint",
"AzureKeyVaultClientId" : "azureClientId"
},
MultiTenantEncryptionKeyProvider- 指示在哪个密钥管理应用程序中存储从 Orchestrator 生成的每个租户的加密密钥。默认情况下,该设置在代码中具有ConfigFileKey值。接受的值是AzureKeyVault和ConfigFileKey。在 Identity Server 安装期间,该值将从 UiPath.Orchestrator.dll.config 的EncryptionKeyPerTenant.KeyProvider设置中复制。
The following Identity Server keys match the Orchestrator keys within UiPath.Orchestrator.dll.config's SecureAppSettings section:
| 身份服务器步骤 | Orchestrator 密钥 |
|---|---|
EncryptionKeyPerTenant | EncryptionKeyPerTenant.Enabled |
AzureKeyVaultAddress | Azure.KeyVault.VaultAddress |
AzureKeyVaultCertificateThumbprint | Azure.KeyVault.CertificateThumbprint |
AzureKeyVaultClientId | Azure.KeyVault.ClientId |
AzureKeyVaultDirectoryId | Azure.KeyVault.DirectoryId |
MultiTenantEncryptionKeyProvider | EncryptionKeyPerTenant.KeyProvider |
If CertificatesStoreLocation parameter in UiPath.Orchestrator.dll.config is set to LocalMachine, make sure that AzureKeyVaultCertificateStoreLocation in appsettings.Production.json has the same value.
If you change the Encryption Key or the Azure Key Vault settings inside Orchestrator’s UiPath.Orchestrator.dll.config, you must also update Identity Server's appsettings.Production.json with the same values.
日志记录
Logging 部分为身份服务器使用的每个组件配置日志级别。这是一个通用的日志记录配置。在此处查找更多信息。
此部分具有 appsettings.json 中的值。
"Logging": {
"LogLevel": {
"Default": "Trace",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
"Logging": {
"LogLevel": {
"Default": "Trace",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
身份服务器为一些主要组件(如 Microsoft 和 Microsoft.Hosting.Lifetime)提供一些默认值。
NLog
NLog 部分用于定义如何通过 NLog 目标在身份服务器中记录信息,就像在 Orchestrator 中一样。
此部分具有 appsettings.json 中的值。
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=
	}}"
}
},
"rules": [
{
"logger": "*",
"minLevel": "Info",
"writeTo": "EventLog"
}
]
},
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=
	}}"
}
},
"rules": [
{
"logger": "*",
"minLevel": "Info",
"writeTo": "EventLog"
}
]
},
默认情况下,NLog 配置为将日志写入应用程序事件。在此处阅读更多有关如何使用 json 部分配置 NLog 的信息。
应用程序设置
AppSettings 部分是身份服务器的主配置部分。此部分具有 appsettings.Production.json 和 appsettings.json 中的值。
-
IdentityServerAddress- 表示身份服务器在验证用于调用身份服务器 API 的令牌时检查的受众。在安装过程中,此字段会自动将身份服务器的地址填充到appsettings.Production.json。 不要修改此值,因为它将中断 Orchestrator 数据传播。此设置具有
appsettings.Production.json和appsettings.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和代码内设置为30分钟。 -
OrchestratorUrl- 表示 Orchestrator 的 URL。当您单击身份管理门户中心菜单中的 Orchestrator 图标时,身份服务器会在此处将您重定向至其他页面。该值在安装过程中在
appsettings.Production.json中设置。备注:确保提供小写 URL 作为
OrchestratorUrl的值;否则,将发生错误。"AppSettings": { "IdentityServerAddress": "https://myIdentity.domain.local/identity", "EnablePII": false, "HideErrorCodesInUi": true, "CookieExpireMinutes": 30, "OrchestratorUrl": "https://myOrchestratorURL.domain.local" } }"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"
}
"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": {
"RedisConnectionString": "",
"SlidingExpirationTimeInSeconds": 600
}
"LoadBalancerSettings": {
"RedisConnectionString": "",
"SlidingExpirationTimeInSeconds": 600
}
在多节点升级情况下,appsetttings.Production.json 中的值会自动从 Orchestrator 的 UiPath.Orchestrator.dll.config 中迁移。如果未在 Orchestrator 中配置 Redis,appsettings.Production.json 将包含此设置。
RedisConnectionString- 只有在将LoadBalancer.UseRedis设置为true时才能使用。一个连接字符串,允许您设置 Redis 服务器,其中包含服务器的 URL、密码和与 Redis 一起使用的端口。也可以在 Orchestrator 节点和 Redis 服务之间启用 SSL 加密连接。有关详细信息,请单击此处。例子:- 启用 SSL -
"RedisConnectionString": A"DOCWREDIS02:6379,password=<your-password>,ssl=true" - 未启用 SSL -
"RedisConnectionString": "DOCWREDIS02:6379,password=<your-password>"
- 启用 SSL -
SlidingExpirationTimeInSeconds- 控制缓存内项目的可调过期时间。此过期时间适用于 Redis 缓存和 InMemory 缓存(当 Redis 不可用时,这是默认值)。
Redis 设置
RedisSettings 部分控制启用哪些缓存。
UseRedisStoreCache- 将其值设置为true以启用 OAuth 客户端数据的 Redis 缓存。使用交互式登录在短时间内连接大量机器人时,这有助于防止出现性能问题。此缓存使用LoadBalancerSettings中指定的相同 Redis 连接字符串。默认情况下,UseRedisStoreCache设置不会显示。
如果您使用外部应用程序功能,则不建议这样做,因为此设置将缓存客户端,并且不会反映对外部应用程序的更新。
UseRedisStoreClientCache- 将其值设置为true,可为第一方客户端(UiPath 应用程序)或第三方客户端(外部应用程序)启用 Redis 缓存。如果您有大规模部署,建议启用此标志。
签名凭据
SigningCredentialSettings 部分描述用于对身份服务器生成的令牌进行签名的证书的位置。此部分中的设置值由安装程序根据您的输入填充。可以配置这些设置,以便从证书存储区或 Azure 密钥保管库中读取证书。
证书轮换设置
ValidationKeys - 用于指示第二个证书的 Name、Location 和 NameType。这是证书轮换的必要操作。
出于安全原因,签名证书必须具有 2048 位公钥。确保证书有效、未过期,并且Identity Server 可以访问私钥。
Refer to Certificate Rotation for more on the adjustments you need to make to the SigningCredentialSettings section to ensure that you always use a certificate within its validity period.
证书存储位置设置示例
下面是在证书存储区内查找证书的传统配置:
"SigningCredentialSettings": {
"StoreLocation": {
"Name": "30f3c11e676fc8eb1f9dd4e330f3ce668d796796",
"Location": "LocalMachine",
"NameType": "Thumbprint"
}
"SigningCredentialSettings": {
"StoreLocation": {
"Name": "30f3c11e676fc8eb1f9dd4e330f3ce668d796796",
"Location": "LocalMachine",
"NameType": "Thumbprint"
}
此示例中,Name 表示指纹值。
我们不建议为 Location 和 NameType 使用其他值。
Azure 密钥保管库位置设置示例
"SigningCredentialSettings": {
"AzureKeyVaultLocation": {
"KeyName": "key_name_534553553"
}
"SigningCredentialSettings": {
"AzureKeyVaultLocation": {
"KeyName": "key_name_534553553"
}
在此示例中,KeyName 表示要在 Azure 密钥保管库内搜索的密钥。
授权
RestrictBasicAuthentication- 允许您配置用户是否可以使用基本身份验证凭据登录 Orchestrator 实例。默认情况下,此设置不会显示在appsettings.Production.json中。以下值可用:true- 用户无法使用基本身份验证凭据登录。false- 用户无法使用基本身份验证凭据登录。这是默认值。
EnableBasicAuthenticationForHostTenant- 允许您配置主机管理员是否可以使用基本身份验证凭据登录 Orchestrator 实例的主机租户。此设置在appsettings.Production.json文件中默认不显示。以下值可用:true- 主机管理员无法使用基本身份验证凭据登录。这是默认值。false- 主机管理员无法使用基本身份验证凭据登录。
此参数绕过 RestrictBasicAuthentication 参数,这意味着如果将 EnableBasicAuthenticationForHostTenant 设置为 true,并且将 RestrictBasicAuthentication 设置为 true,则只能在主机级别使用基本身份验证凭据登录。