Authentication
Authentication is disabled by default. Enable authentication to require users to sign in before accessing the LicensePredictor dashboard and Blazor connection.
When authentication is enabled, the endpoints required for the sign-in flow, such as login, callback, SAML protocol, access-denied endpoints, and required static assets, remain accessible.
Activating Authentication
Follow these instructions to enable authentication and configure the common authentication settings.
Step 1: Open the appsettings.json file
-
Navigate to the LicensePredictor directory.
By default, this is located at:
C:\Program Files\OpeniT\LicensePredictor -
Open the
appsettings.jsonfile.
Step 2: Configure the Authentication Settings
-
Locate the
Authenticationsection in theappsettings.jsonfile. -
Configure the following settings:
-
Enabled— Set totrueto enable authentication. The default value isfalse.Set to
falseto retain the existing unauthenticated deployment behavior. -
Provider— Specify the identity provider to use for authentication. Accepted values areAzureAd,Oidc, andSaml. The default value isAzureAd.NoteLicensePredictor validates the settings required by the selected authentication provider during startup.
-
LoginPath— Specify the endpoint that starts the sign-in process. The default value is/auth/login.The value must begin with
/and must not contain a query string or fragment. -
LogoutPath— Specify the endpoint used for signing out. The default value is/auth/logout. -
AccessDeniedPath— Specify the endpoint used when access is denied. The default value is/auth/access-denied.
Example: appsettings.json"Authentication": {
"Enabled": true,
"Provider": "AzureAd",
"LoginPath": "/auth/login",
"LogoutPath": "/auth/logout",
"AccessDeniedPath": "/auth/access-denied", -
-
Save the changes.
Step 3: Restart the LicensePredictor Service
-
Open Task Manager.
-
Under Services, restart the OpeniTLicensePredictor service.
Configuring Cookie Setting
Follow these instructions to configure the cookie settings.
Step 1: Open the appsettings.json file
-
Navigate to the LicensePredictor directory.
By default, this is located at:
C:\Program Files\OpeniT\LicensePredictor -
Open the
appsettings.jsonfile.
Step 2: Configure the Cookie Settings
-
Locate the
Cookiesection underAuthenticationin theappsettings.jsonfile. -
Configure the following settings:
-
Name— Specify the name of the authentication cookie. The default value is.LicensePredictor.Auth. Use a unique name when multiple applications share the same host. -
ExpireMinutes— Specify the authentication cookie lifetime in minutes. Accepted values are5through43,200, and the default value is480. -
SlidingExpiration— Set totrueto renew the authentication cookie during active use. The default value istrue.Set this to
falsewhen the deployment requires a fixed session lifetime. -
SecurePolicy— Specify when the authentication cookie requires HTTPS. Accepted values areAlways,SameAsRequest, andNone. The default value isAlways.noteKeep
SecurePolicyset toAlwaysfor production deployments and serve LicensePredictor through HTTPS.
Example: appsettings.json"Cookie": {
"Name": ".LicensePredictor.Auth",
"ExpireMinutes": 480,
"SlidingExpiration": true,
"SecurePolicy": "Always" -
-
Save the changes.
Step 3: Restart the LicensePredictor Service
-
Open Task Manager.
-
Under Services, restart the OpeniTLicensePredictor service.