Skip to main content

Application Settings

This section describes the settings available in the server's appsettings.json file, located in the server's working directory or in environment variables.

JSON files can contain any additional information that you might find useful. See the example below.

For example, in order to store the agent's address, we can add:


appsettings.json

"UsercubeAgent": {
"Url": "http://localhost:1234"
}

As Usercube does not know any object named UsercubeAgent, its content will be ignored, but it can still be used to store information for human use.

The appsettings set allows the following attributes and sections:

NameDetails
ApplicationUri requiredType String Description URI of the server to use in log messages, to communicate with the server in tasks, to allow certain redirect URIs. Note: must be the same as the agent's appsettings.json's ApplicationUri. Exampleappsettings.json { � "ApplicationUri": "usercubeserver.contoso.com:5000" }
EncryptionCertificate requiredType [EncryptionCertificate] Description Settings to configure the encryption of specific files.
License requiredType String Description License key of the server. Exampleappsettings.json { � "License": "{"LicensedTo":"Demo","ValidTo":"20120905","IdentityQuota":"10000","Signature":"�"}" }
Agents optionalType Agent List Description List of agents' settings used to work on several environments. Info: this way, each agent's URI/URL is configured without altering the database. Exampleappsettings.json { � "Agents": { "Local": { "Uri": "http://localhost:5010" }, � } }
AppDisplay optionalType AppDisplay Description Settings to override the application display XML configuration. Info: useful to change the application's theme and name without redeploying the whole configuration.
ApplicationInsights optionalType ApplicationInsights Description Settings to plug to and configure the AppInsights monitoring tool.
DataProtection optionalType DataProtection Description Settings to configure the encryption used for the authentication cookies and the anti-forgery tokens. Info: data protection can be configured to share the keys between several instances of Usercube's server, for example when deployed in a cluster where the servers do not have the same machine id.
InstallationDirectoryPath default value: Usercube-Server.exeType String Description Path of the installation directory. Info: used to read other configuration files. Exampleappsettings.json { � "InstallationDirectoryPath": "C://identitymanagerContoso/Runtime" }
MailSettings optionalType MailSettings Description Settings to configure the email service.
NotUseAgent default value: falseType Boolean Description True to disable the use of the agent. Exampleappsettings.json { � "NotUseAgent": true }
OpenIdClients optionalType OpenIdClient List Description List of hashed secrets used to override the plain-text secrets from the OpenIdClient XML configuration. Info: this way, Usercube stores only hashed secrets, for security purposes. Note: each environment must have its own secret, distinct from the others. Exampleappsettings.json { � "OpenIdClients": { "Job": { "HashedSecret": "K7gNU3sdo+OL0wNhqoVWhr3g6s1xYv72ol/pe/Unols" }, "PowerBI": { "HashedSecret": "7b8N2NWka5alDrjM7rFqf7+xqq9LIcT5jSoQ+1Ci2V0" } } }
PowerBISettings optionalType PowerBISettings Description Settings to configure the API used by Power BI to access Usercube data.
Serilog optionalType Serilog Description Settings to configure the logging service, complying to the Logger properties and structure. Exampleappsettings.json { � "Serilog": { "WriteTo": [ "Console" ], "MinimumLevel": { "Default": "Error", "Override": { "Usercube": "Information" } } } }
Swagger optionalType Swagger Description Enabling Swagger enables visualizing and interacting with the API's resources without having any of the implementation logic in place. Info: it is automatically generated from Usercube's API, with the visual documentation making it easy for back-end implementation and client-side consumption.
TempFolderPath default value: ../TempType String Description Path to the temporary folder which contains: - ExportOutput: directory storing data exported from connectors. - JobLogs: directory storing task instance logs. - Reports: directory storing generated reports. - Packages: directory storing the downloaded package logos. - PolicySimulations: directory storing the files generated by policy simulations. - ProvisioningCache.txt: file storing the clustered provisioning cache. Note: when enabled, this file can be used to coordinate the API cache among clusters. - CorrelationCache.txt - RiskCache.txt - ExpressionCache.txt - scheduler.lock - connector.txt - container.reset.txt: file acting as a reset command for Usercube's server, i.e. any change to this file triggers the reset service, thus reloading all the services instantiated by the server. Note: this path can be overridden by ResetSettings > FilepathResetService. - Mails: directory storing the email messages. Note: this path can be overridden by ResetSettings > PickupDirectory. - Deployment Note: these elements can be removed, but make sure to restart the server after doing so. Exampleappsettings.json { � "TempFolderPath": "../Temp" }
WorkFolderPath default value: ../WorkType String Description Path of the work folder which contains: - Collect: directory storing the CSV source files exported by connectors. - ProvisioningOrders: directory storing the orders generated by the server. - FulfillPowerShell: PowerShell provisioner's working directory. - FulfillRobotFramework: Robot Framework's provisioner working directory. - ExportCookies: directory storing the cookies used for incremental export. - Synchronization: directory storing the agent's data collection results. - Upload: directory storing the uploaded media like uploaded pictures, before they are inserted into the database. - appsettings.connection.json Note: these elements must not be removed, because doing so may disrupt Usercube's execution after restarting. Exampleappsettings.json { � "WorkFolderPath": "../Work" }

Swagger

NameDetails
Enabled requiredType Boolean Description True to enable Swagger. Exampleappsettings.json { � "Swagger": { "Enabled": false }, }

EncryptionCertificate

This information can be set one of two ways:

  • As a Public Key Cryptography Standards (PKCS) #12 archive (also called Personal Information Exchange file or .pfx file) stored in the Agent's host file system. The archive contains both the public key certificate and the private key.

  • As a certificate from a Windows' certificate store identified by SubjectDistinguishedName or by Thumbprint. The Windows certificate also contains both the public key certificate and the private key.

    NETWRIX recommends using Windows' certificate store.

    On the other hand, the PFX file takes priority over Windows' certificate, which means that when File is specified then the PFX certificate is used, even if the options for Windows' certificate are specified too.

    In both ways, missing and/or incorrect settings trigger an error and no certificate is loaded.

As a PFX file

For example:


{
...
"EncryptionCertificate": {
"File": "C:/identitymanagerAgentContoso/contoso.pfx",
"Password": "oarjr6r9f00"
}
}

The archive is set using the following attributes:

NameDetails
File requiredType String Description PKCS #12 archive path on the host file system.
Password optionalType String Description PKCS #12 archive password.

Storing a .pfx file password in plain text in a production environment is strongly discouraged. It should always be encrypted using the Usercube-Protect-CertificatePassword tool.

The archive is set using the following attributes:

NameDetails
File requiredType String Description PKCS #12 archive path on the host file system.
Password optionalType String Description PKCS #12 archive password. Info: storing a .pfx file's password in plain text in a production environment is strongly discouraged. It should always be encrypted using the Usercube-Protect-CertificatePassword.exe tool.

As a Certificate in the Windows Store

For example:


{
...
"EncryptionCertificate": {
"DistinguishedName":"UsercubeContoso",
"StoreLocation": "LocalMachine",
"StoreName": "AuthRoot"
}
}

The Windows certificate is set using these attributes:

NameDetails
DistinguishedName optionalType String Description SubjectDistinguishedName of the store certificate. Note: required when Thumbprint is not specified.
Thumbprint optionalType String Description Thumbprint of the store certificate. Note: required when DistinguishedName is not specified.
StoreLocation requiredType String Description Location of the relevant Windows certificate store: LocalMachine or CurrentUser.
StoreName requiredType String Description Name of the relevant Windows certificate store.

Using Azure Key Vault

If the certificate is saved in Azure Key Vault, we must define the certificate identifier and the Vault connection.


"EncryptionCertificate": {
"CertificateAzureKeyVault": "<CertificateIdentifier>"
}

Disabling file encryption

The encryption of specific files can be disabled via the following attribute:

NameDetails
EncryptFile default value: trueType Boolean Description True to encrypt specific files such as logs or temporary files. Exampleappsettings.json { � EncryptionCertificate": { "EncryptFile": false } }

MailSettings

For example:

appsettings.json

{
...
"MailSettings": {
"FromAddress": "no-reply@acme.com",
"PickupDirectory": "C:/identitymanagerDemo/Temp/Mails",
"UseSpecifiedPickupDirectory": true,
"UseDefaultCredentials": false,
"SecureSocketOption": "StartTlsWhenAvailable"
}
}
NameDetails
FromAddress requiredType String Description Email address used as sender for Usercube's emails.
AllowedDomains optionalType String Description List of allowed domains, separated by ;.
CatchAllAddress optionalType String Description Email address to be used as catchAll.
CatchAllCCAddress optionalType String Description Email address to be used as CC catchAll.
Enabled default value: trueType Boolean Description True to activate Usercube's email services.
EnableSsl default value: falseType Boolean DEPRECATED: EnableSsl won't be supported in the future. Please specify a SecureSocketOption instead. To keep the same behavior as EnableSsl: True, use the setting SecureSocketOption: StartTls. Description True to encrypt communication with the SMTP server. Note: to be used only when UseSpecifiedPickupDirectory is set to false.
SecureSocketOption default value: AutoType String Description Specifies the encryption strategy to connect to the SMTP server. If set, this takes priority over EnableSsl. None: No SSL or TLS encryption should be used. Auto: Allow the mail service to decide which SSL or TLS options to use (default). If the server does not support SSL or TLS, then the connection will not be encrypted. SslOnConnect: The connection should use SSL or TLS encryption immediately. StartTls: Elevates the connection to use TLS encryption immediately after reading the greeting and capabilities of the server. If the server does not support the STARTTLS extension, then the connection will fail and a NotSupportedException will be thrown. StartTlsWhenAvailable: Elevates the connection to use TLS encryption immediately after reading the greeting and capabilities of the server, but only if the server supports the STARTTLS extension. Note: to be used only when UseSpecifiedPickupDirectory is set to false.
Host optionalType String Description Name or IP address of the host used for SMTP transactions. Note: required when UseSpecifiedPickupDirectory is set to false.
Password optionalType String Description Password to be used with the user name as credentials.
PickupDirectory optionalType String Description Path of the folder where Usercube will save the email messages. Note: useful and required when UseSpecifiedPickupDirectory is set to true.
Port optionalType String Description Port used for SMTP transactions. Note: required when Host is defined.
UseDefaultCredentials default value: falseType Boolean Description True to use in requests the default credentials instead of those from UserName and Password here.
UserName optionalType String Description User name to be used with the user name as credentials.
UseSpecifiedPickupDirectory default value: falseType Boolean Description True to save email messages to the folder specified in PickupDirectory instead of sending them to their recipients through the host specified in Host. Note: required when Host is not defined.

ApplicationInsights

For example:


appsettings.json

{
...
"ApplicationInsights": {
"InstrumentationKey": "<AppInsights instance's key>"
}
}
NameDetails
InstrumentationKey default value: nullType String Description Key linked to the AppInsights instance to which the server's logs, requests, dependencies and performance are to be sent. See Microsoft's documentation to create an instrumentation key.

The logs sent to AppInsights are configured through the Logger properties.

PowerBISettings

For example:

appsettings.json

{
"PowerBISettings": {
"PageSize": 500
}

}
NameDetails
PageSize default value: 1000Type Int32 Description Size of the page containing the data returned by the API.

DataProtection

For example:

appsettings.json

{
"DataProtection": {
"KeysPath": "/home/DataProtection",
"X509KeyFilePath": "../identitymanager.pfx",
"X509KeyFilePassword": "secret"
},
}
NameDetails
KeysPath default value: ../Work/DataProtectionType String Description Path of the location where the keys' descriptions are stored.
X509KeyFilePath optionalType String Description Path of the custom certificate used to protect the keys.
X509KeyFilePassword optionalType String Description Password of the custom certificate used to protect the keys.

AppDisplay

For example:

appsettings.json

{
...
"AppDisplay": {
"PrimaryColor": "#01CDE9",
"SecondaryColor": "#EA6E1A",
"BannerColor": "#EA6E1A",
"BannerTextColor": "#ffffff",
"ApplicationNamePrefix": "QA - ",
"ApplicationName": "USERCUBE"
},
...
}
NameDetails
ApplicationName optionalType String Description Name of the application, visible on the application's tabs.
ApplicationNamePrefix optionalType String Description Prefix to be displayed before the application name.
BannerColor optionalType String Description HEX code of the color for the banner, i.e. the header displaying logo and navigation bar.
BannerTextColor optionalType String Description HEX code of the color for the banner's text.
PrimaryColor optionalType String Description HEX code of the color for the highlighted buttons.
SecondaryColor optionalType String Description HEX code of the color for the background of the authentication screen.

See more details on application display settings.