Skip to main content
Version: 10.3

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​

  1. Navigate to the LicensePredictor directory.

    By default, this is located at: C:\Program Files\OpeniT\LicensePredictor

  2. Open the appsettings.json file.

Step 2: Configure the Authentication Settings​

  1. Locate the Authentication section in the appsettings.json file.

  2. Configure the following settings:

    • Enabled — Set to true to enable authentication. The default value is false.

      Set to false to retain the existing unauthenticated deployment behavior.

    • Provider — Specify the identity provider to use for authentication. Accepted values are AzureAd, Oidc, and Saml. The default value is AzureAd.

      Note

      LicensePredictor 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",
  3. Save the changes.

Step 3: Restart the LicensePredictor Service​

  1. Open Task Manager.

  2. Under Services, restart the OpeniTLicensePredictor service.

Follow these instructions to configure the cookie settings.

Step 1: Open the appsettings.json file​

  1. Navigate to the LicensePredictor directory.

    By default, this is located at: C:\Program Files\OpeniT\LicensePredictor

  2. Open the appsettings.json file.

  1. Locate the Cookie section under Authentication in the appsettings.json file.

  2. 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 are 5 through 43,200, and the default value is 480.

    • SlidingExpiration — Set to true to renew the authentication cookie during active use. The default value is true.

      Set this to false when the deployment requires a fixed session lifetime.

    • SecurePolicy — Specify when the authentication cookie requires HTTPS. Accepted values are Always, SameAsRequest, and None. The default value is Always.

      note

      Keep SecurePolicy set to Always for production deployments and serve LicensePredictor through HTTPS.

    Example: appsettings.json
    "Cookie": {
    "Name": ".LicensePredictor.Auth",
    "ExpireMinutes": 480,
    "SlidingExpiration": true,
    "SecurePolicy": "Always"
  3. Save the changes.

Step 3: Restart the LicensePredictor Service​

  1. Open Task Manager.

  2. Under Services, restart the OpeniTLicensePredictor service.