AMT Help Files

Blazor WebClient Server Appsettings

This page lists all settings found in the appsettings.json file for the Blazor WebClient Server.

 

ClientBlazor WebClient Server

The appsettings.json file is located in the following directory: ..\<AMT root>\Apps\<Application>\ClientBlazor\WebClient\Server\.

 

 
 Note: the appsettings.json file name is case sensitive and must be lowercased.

 

Settings

The appsettings file is (sub-)divided into the following sections.

 

Section Description
Amt The main section where most settings are located.
Logging Section for the logging settings for the Web Application.
AllowedHosts Solo settings which restricts the hosts which may access the Web Application.

 

 

{
  "Amt": {
 
    },
    "Authentication": {
      "AmtOIDC": {
          },
        },
          }
        },
      }
    },
  },
    }
  },
}

 

RuntimeBehaviour

Sets the runtime behaviour to either Lion, Cobol or Natural.
For AMT Lion applications this should be set to Lion.


"RuntimeBehaviour": "Lion",

 

HttpRequestTimeout

The HTTP request timeout in seconds.


"HttpRequestTimeout": 7200,

 

KeepAliveInterval

The number of seconds between keepalive calls to the client, the default value is 60.


"KeepAliveInterval": 60,

 

MaxRequestLength

By default the maximum size of data uploaded to the AMT Blazor WebClient is limited to 10240 kilobytes (10 megabytes) per HTTP request.
To increase the upload size, for instance to allow for larger files to be uploaded via the File uploader control, the MaxRequestLength setting can be increased.
Note that this setting limits the whole HTTP request, not just the file(s) to be uploaded, meaning that the limit should be set higher than the maximum intended file size.

This setting controls the upload limit in kilobytes, it is a 32 bit integer which limits the setting to a maximum value of 2147483647.


"MaxRequestLength": 10240,

 

Theme

Theme: The name of the folder located in wwwroot\app_themes which contains custom theme CSS files that will be used for the styling of the Web Application.
NoDefaultTheme: When set to true, the default CSS files will not be loaded. Default is false.

 The default CSS files will loaded before the custom theme (unless NoDefaultTheme is set to True).
If Theme is set to a value, this custom theme will be loaded as separate CSS files which will override the default CSS styling.

"Theme": "MyTheme",
"NoDefaultTheme": false,

Creating a Custom Application Theme in a Blazor WebClient


 

HideMainMenu

When set to true, the Menu bar at the top of the application will be hidden. (AMT Lion only)


"HideMainMenu": false,

 

IsVSApplication

If an application is an AMT for CSharp application (Visual Studio) that uses static webpages, this setting should be set to true.


"IsVSApplication": false,

 

LoadAndRun

The LoadAndRun JavaScript script is a customer specific customization created during migration which can modify the values to and from an AMT web client form by hooking into a form at certain loading stages on runtime. The LoadAndRun script can be enabled with these settings.

ObjectFields: The names of the object fields which must be present in the form for the LoadAndRun script to hook into.
LoadAndRun: Setting the value to "true" will enable the LoadAndRun script for the application.
LoadAndRunJs: The name and location of the script relative to the wwwroot\scripts folder of the web client.


"ObjectFields": "TESTFIELD1;TESTFIELD2",
"LoadAndRun": true,
"LoadAndRunJs": "loadandrun",

 

Customize

If a client specific customize JavaScript script was created for an application during migration, it can be enabled with these settings.

LoadCustomize: Setting the value to "true" will enable the customize script for the application.
CustomizeJs: The name and location of the script relative to the wwwroot\scripts folder of the web client.


"LoadCustomize": true,
"CustomizeJs": "customize",

 

AdditionalErrorDetails

When set to true, the AmtExceptionPage provides additional error information.


"AdditionalErrorDetails": false,

 

Additional Javascripts

These options can be set if additional javascript files are required in the Web Client.

LoadAdditionalJavascripts: Setting the value to "true" will activate the javascript files set in the AdditionalJavascripts setting.
AdditionalJavascripts: The location of the scripts relative to the wwwroot\scripts folder of the web client, multiple scripts can be entered if separated by a semicolon (;). The .js file extension should not be included.


"LoadAdditionalJavascripts": true,
"AdditionalJavascripts": "Javascript1;Javascript2",

 

UseNotifyBar

UseNotifyBar enables or disables a notification bar in the web client.
When messages are send to the station of a user, a notification bar will appear to display the message and disappear after a set time. The default value is true.
With NotifyBarTime the default visibility duration of the bar can be changed by setting a time in seconds, the default value is 120 seconds (2 minutes).
Alternatively the notification bar can be closed manually by clicking the close button on the bar.


"UseNotifyBar": true,
"NotifyBarTime": 120

 

BlazorWebApi

Settings needed to communicate with the Blazor WebAPI.

Protocol: The protocol to be used for the Blazor WebAPI, either Https or Http.
Domain: This setting should contain the URL of the Blazor WebApi website without the protocol prefix.
Port: Set to 0 for normal operations. Other values are used for debugging.
The port setting is used when debugging Blazor locally without IIS. Set to 0 when hosted on IIS.


"BlazorWebApi": {
  "Protocol": "Https",
  "Domain": "<domain>[:port]/<path>",
  "Port": 0,
},

 

AuthenticationType

The authentication type used to log into the Blazor WebClient, the only valid option is "OIDC" (OpenID Connect).


"AuthenticationType": "OIDC",

 

AmtOIDC - OIDC

This section holds the settings for OpenID Connect authentication.


"AmtOIDC": {
  "OIDC": {
    "ClientId": "amt-blazor-webclient-server",
    "Authority": "https://login.example.org/amt-applications/v2/auth",
    "Scope": [ "openid profile amt-blazor-webapi-scope" ],
    "ClientSecret": "c8A6L7j5E3N0n9Y",
    "TokenValidationParameters": {
      "NameClaimType": "preferred_username"
    },
    "RequireHttpsMetadata": true
  },
...

 

AmtOIDC - CookieAuthenticationOptions

The 'CookieAuthenticationOptions' section holds settings for the cookie used for user authentication.


"AmtOIDC": {
...
  "CookieAuthenticationOptions": {
    "Cookie": {
      "Name": ".Amt.Blazor.ApplicationName.Auth",
      "Domain": "",
      "Path": "/",
      "SameSite": "None"
    }
  },
...

 

AmtOIDC

This section holds the remaining OpenID Connect options.


"AmtOIDC": {
  ...
  "DisableRefreshTokens": false,
  "RefreshThreshold": 60,
  "EnableClientAssertion": false,
  "ClientAssertionAlgorithm": "RS256",
  "CertificateConfig": {
  ...

AmtOIDC - CertificateConfig

Configuration options for the certificate used to sign the client assertion. This section can be left out if client assertion is disabled.


"AmtOIDC": {
  ...
  "CertificateConfig": {
    "AllowInvalid": true,
    "Subject": "amt-application-cert",
    "StoreName": "MY",
    "StoreLocation": "LocalMachine",
    "Path": "certificate.pfx"
    "Password": ""
  }
}

 

Logging

Sets the logging levels for the various ASP.NET Core components of the web application. These settings do not need be adjusted in a normal situation.
The allowed log levels are, from most to least detailed: Trace, Debug, Information, Warning, Error, Critical and None.


"Logging" {
  "LogLevel": {
    "Default": "Information",
    "Microsoft": "Warning",
    "Microsoft.Hosting.Lifetime": "Information",
    "System.Net.Http": "Warning"
  }
},

 

AllowedHosts

In the AllowedHosts section, access to the web application can be restricted to specific hostnames.
The value is a semicolon-delimited list of host names without port numbers.
By default all hostnames are allowed by the asterisk (*) wildcard.
Disallowed users will get a HTTP 400 error code (Bad Request).


"AllowedHosts": "*"