Last updated

Authentication and authorization

For VENUS 6.3 or later, authentication and authorization provides a secure way to interact with the VENUS Web API by ensuring that endpoints are only accessed by authorized users.

Authentication and authorization is enabled when Function Protection is set to Enabled in the Hamilton System Configuration Editor. (By default, Function Protection is set to Disabled.)

Function Protection Setting

Operating system security groups

Upon installation of VENUS, new OS security groups are created to govern user access to functions in the VENUS software.

The following table shows the OS security groups created on installation of VENUS. The roles are listed from the highest role precedence to the lowest.

Group

User

Description

Role

Lab Service

Service Tech/Lab Manager

All-access

Admin

Lab Method Programmer

Method Programmer/Lab Manager

Modify method and labware definitions.

Lab Method Programmer

Lab Operator 2

Routine user+

Run methods and rearrange deck.

Lab Operator 2

Lab Operator

Routine user

Run verified methods.

Lab Operator

Endpoints in the VENUS Web API are accessible and viewable by users of any role. An exception to this is the GET authentication-mode endpoint, which is accessible by users without a VENUS role. Endpoints that handle sensitive data, such as log files, run history, and importing methods, are restricted to users with an Admin or Lab Method Programmer role.

The following table lists endpoints that require elevated permissions. Endpoints that aren't listed in the table are accessible by users of any role.

Endpoint

Permission

/api/vector/v3/files/import-method

Lab Service, Lab Method Programmer

/api/vector/v3/files/import-methods

Lab Service, Lab Method Programmer

/api/vector/v3/files/import-method-package

Lab Service, Lab Method Programmer

/api/vector/v3/files/cleanup

Lab Service, Lab Method Programmer

/api/vector/v3/system/venus/archive

Lab Service, Lab Method Programmer

/api/vector/v3/system/invalidate-run-history-cache

Lab Service, Lab Method Programmer

Enable authentication

This section describes how to enable authentication through the Hamilton System Configuration Editor application.

Authentication can only be enabled by users in the Lab Service group.

Before enabling authentication, assign users to the appropriate operating system security group. For more information, refer to Operating system security groups.

To enable authentication:

  1. Launch Hamilton System Configuration Editor (Hamilton.HxConfigEditor).

  2. Select the Security Settings tab.

  3. Under Access restrictions, select the Function Protection drop-down and select enabled.

  4. Save the settings.

  5. Close the Hamilton System Configuration Editor.

Use external identity and access management providers

The VENUS Web API supports the use of Identity and Access Management (IAM) solutions such as Auth0, Microsoft Entra, and Okta. Use an IAM solution in place of the Identity Provider created by VENUS.

Identity and access management prerequisites

Before connecting an IAM solution to the VENUS Web API, the IAM solution requires the following:

  • An API endpoint to request and validate access tokens that provide authorized access to the Web API.

  • An application to authenticate users. This would be a client application interacting with the Web API.

  • Roles matching the operating system security groups created by VENUS.

  • Users with assigned VENUS roles.

  • A role claim with “hamiltonRoles” as the claim name.

Configure Web API identity

To configure the Web API to use an IAM for authentication and authorization:

  1. Open C:\Program Files (x86)\Hamilton\Bin\WebAPI\WebAPI.Host.appsettings.json.

  2. Locate the subsection Bearer in the Authentication section and update the following settings:

    • Authority to the base URL of the identity provider. This is used to validate the issuer of the token.

    • MetaDataAddress to the OpenID Connect metadata document of the associated issuer.

    • ValidAudiences to the list of valid audiences for the token.

    • ValidIssuer to the expected issuer of the token.

  3. Save the file and close. The files are in a subdirectory in Program Files (x86) and are administrator-access only.

  4. Open the Services system application and select Hamilton VENUS WebAPI Host.

  5. Restart the Web API host.

Customize VENUS Web API authentication and authorization settings

The VENUS Web API provides settings to customize the Kestrel configuration and Identity Provider configuration. VENUS Web API and Identity Provider uses the default host, Microsoft’s Kestrel server, to self-host.

For more information on Microsoft’s Kestrel server, go to Microsoft's Kestrel web server in ASP.NET Core page.

Customize VENUS Web API Kestrel server settings

Configure the VENUS Web API to use HTTPS. Customize the Kestrel server configuration (if it's configured) to use a different host name, certificate, and password.

To enable HTTPS with the Web API:

  1. Navigate to the C:/Program Files (x86)/Hamilton/Bin/WebAPI folder and open WebAPI.Host.appsettings.json.

  2. For the UseHttps setting, replace false with true.

  3. Save the file and close. The files are in a subdirectory in Program Files (x86) and are administrator-access only.

  4. Launch the Services system application and select Hamilton VENUS WebAPI Host.

  5. Restart the Web API host.

To change the Web API’s Kestrel server configuration:

  1. Navigate to the C:/Program Files (x86)/Hamilton/Bin/WebAPI folder and open WebAPI.Host.appsettings.json.

  2. Update the Port, Path, and Password settings to the desired values.

  3. Save the file and close. The files are in a subdirectory in Program Files (x86) and are administrator-access only.

  4. Launch the Services system application and select Hamilton VENUS WebAPI Host.

  5. Restart the Web API host.

Clients changing the host name must provide their own pfx certificate file, password and an updated DNS name saved in the C:/Program Files(x86)/Hamilton/Bin directory.

Customize Identity Provider configuration

The Identity Provider that VENUS provides can use different client and kestrel configurations. Client configuration is handled in the IdentityProvider.appsettings.json file, and the Kestrel server configuration is handled in the IdentityProvider.appsettings.Production.json file. All files are located in C:/Program Files (x86)/Hamilton/Bin/IdentityProvider.

To change the Identity Provider’s client configuration:

  1. Navigate to the C:/Program Files (x86)/Hamilton/Bin/IdentityProvider folder and open IdentityProvider.appsettings.json.

  2. Update the ClientID and ClientSecret settings to the desired values.

  3. Save the file and close. The files are in a subdirectory in Program Files (x86) and are administrator-access only.

  4. Launch the Services system application and select Hamilton VENUS Identity Provider.

  5. Restart the Identity Provider service.

To change the Identity Provider’s kestrel configuration:

  1. Navigate to the C:/Program Files (x86)/Hamilton/Bin/IdentityProvider folder and open IdentityProvider.appsettings.json.

  2. Update the Port, Path, and Password settings to the desired values.

  3. Save the file and close. The files are in a subdirectory in Program Files (x86) and are administrator-access only.

  4. Launch the Services system application and select Hamilton VENUS Identity Provider.

  5. Restart the Identity Provider service.

When changing the Kestrel server configuration, the URL must be HTTPS. The host is explicitly wildcarded. If the client changes the hostname, a pfx certificate file, password, and an updated DNS name saved in C:/Program Files(x86)/Hamilton/Bin are required.