SAML
SAML
Updated on Jul 20, 2026
Published on Oct 30, 2024
8 minute(s) read
SAML (Security Assertion Markup Language) is an open standard that allows identity providers (IdPs) to pass authorization credentials to service providers (SPs) via transactions that use XML (extensible markup language) for communication between the SP and the IdP.
On-premise / private cloud instances
Local setup
Required configuration steps
Hyperscience currently supports SP-Initiated SSO. To enable SAML authentication in Hyperscience:
Add the following setting to your “.env ” file:
# Enables SAML Authentication HS_LOGIN_ENABLE_SAML=trueSet the value of SAML_ENTITY_ID to the same value that is registered with your IdP. The Entity ID should be a unique identifier for your Hyperscience installation and is usually set to its URL.
SAML_ENTITY_ID=http://your.hyperscience.urlMake an XML metadata file that describes the configuration of your IdP available to your Hyperscience installation. We provide 2 options for this step:
Remote metadata URL
If your IdP's metadata is publicly available, you can point Hyperscience to that URL:
SAML_METADATA_URL=http://idp.metadata.url
For example, your SAML_METADATA_URL variable may look something like this:
SAML_METADATA_URL=https://www.server.com:8080/context/saml/metadata
Local metadata file
If the metadata is not hosted or is not accessible to your Hyperscience installation, you may download its file from your IdP and make it accessible to Hyperscience:
Create the
/mnt/hs/certsfolder on each machine running Hyperscience:mkdir -p /mnt/hs/certsApply the proper SELinux context, if enabled (Redhat has this context enabled by default):
chcon -t container_file_t -R /mnt/hs/certsCreate the
/mnt/hs/certs/metadata.xmlfile, and enter the IdP metadata in that file.Set
SAML_METADATA_PATH=/etc/nginx/certs/metadata.xml.Provide the group values that will map to the admin role in Hyperscience. Currently, we accept one possible admin role.
SAML_ADMIN_PERMISSION_ROLE=your_admin_group
Identity configuration
A user's identity in SAML is mapped to their username in Hyperscience. By default, Hyperscience assumes that identity is case-sensitive but configurable. See the table below for more details:
| Environment Variable | Default | Description |
| SAML_DJANGO_USER_MAIN_ATTRIBUTE_CASE_SENSITIVE | TRUE | Identity in the IdP is case-sensitive. |
Configuring attribute mapping
Hyperscience supports SAML attribute mapping, allowing you to auto-populate user-specific information in Hyperscience based on the data stored in your IdP. Below is a list of the supported attribute values. These values are fully customizable.
| Environment Variable | Default (Attribute Name) | Description |
| SAML_USER_AUTH_ATTR | authorities | The name of the attribute used to identify the user's group |
| SAML_USER_FIRST_NAME_ATTR | FirstName | Name of IdP's attribute for a user's first name |
| SAML_USER_LAST_NAME_ATTR | LastName | Name of IdP's attribute for a user's last name |
| SAML_USER_EMAIL_ATTR | mail | Name of IdP's attribute for a user's email address |
Configuring assertions and authentication request options
Response and assertions signature requirements
Hyperscience supports both signed and unsigned assertions and responses from the identity provider. In addition, you can configure Hyperscience to accept only signed responses. You can control this behavior via the following “.env” file variables (default values shown below):
SAML_WANT_ASSERTIONS_SIGNED=False
SAML_WANT_RESPONSE_SIGNED=True
Encrypted assertions
In certain deployment scenarios, an identity provider encrypts the assertions within a response. To enable Hyperscience to decrypt such responses you need to:
Obtain a certificate and key for decryption from the identity provider. See your identity provider’s documentation for specific steps on how to complete this process.
Create the
/mnt/hs/certs/samlfolder on each machine running Hyperscience:mkdir -p /mnt/hs/certs/samlApply the proper SELinux context, if enabled (Redhat has it enabled by default):
chcon -t container_file_t -R /mnt/hs/certschcon -t container_file_t -R /mnt/hs/certs/saml
Create the following files:
/mnt/hs/certs/saml/encrypt-private-key.pem(holding the PEM-encoded private key of the decryption certificate)/mnt/hs/certs/saml/encrypt-public-cert.pem(holding the PEM-encoded decryption certificate)
Set
SAML_CONFIG_DIR=/etc/nginx/certs/samlSet
SAML_DECRYPT_ASSERTIONS=True
Signed authentication requests
Certain deployment scenarios may require Hyperscience to send signed authentication requests to the identity provider. To configure this behavior, follow these steps:
Obtain the certificate and key for request signing. Doing so may require additional setup on the identity provider’s side. See the instructions for your IdP.
Create the
/mnt/hs/certs/samlfolder on each machine running Hyperscience:mkdir -p /mnt/hs/certs/samlApply the proper SELinux context, if applicable:
chcon -t container_file_t -R /mnt/hs/certschcon -t container_file_t -R /mnt/hs/certs/saml
Create the following files:
/mnt/hs/certs/saml/sign-private-key.pem(holding the PEM-encoded private key of the signing certificate)/mnt/hs/certs/saml/sign-public-cert.pem(holding the PEM-encoded signing certificate)
Set
SAML_CONFIG_DIR=/etc/nginx/certs/samlSet
SAML_AUTHN_REQUESTS_SIGNED=True
(Optional) Overriding Assertion Consumer Service URL
If you're running v33.1.28 or later, you can use the SAML_ACS_URL variable in your “.env” file to override the assertion consumer service (ACS) URL.
(Optional) Remote metadata signature validation
By default, Hyperscience validates remote metadata signatures using the embedded certificate. If you want to use another certificate instead, you can do so by entering its path as a value for the SAML_METADATA_CERT_PATH variable in your “.env” file.
Remote setup
Okta
These instructions will configure Hyperscience to use an Okta application as an IdP. They use as many default values as possible, with the minimal configuration necessary on the Hyperscience side.
To set up your Okta application:
Configure the General settings:
- Configure your application to use SAML authentication.
- Set your Single sign on URL to the domain where Hyperscience is hosted, at the path
/saml2/acs/,including the trailing slash. - Set your Audience URI to your application's domain. This value must match the value of the
SAML_ENTITY_IDsetting. - Set the Application username to the field that you want to use to populate usernames inside Hyperscience.
To map first name, last name, and email from Okta to Hyperscience, set the following user attributes.
We require group information to determine a user's access permissions inside Hyperscience. To send this information, create an Okta filter that includes all groups of users who will be accessing Hyperscience.
You can find the link to your IdP's metadata by clicking Identity Provider metadata.
Configure your Hyperscience “.env” file:
# Required settings HS_LOGIN_ENABLE_SAML=true SAML_ENTITY_ID=http://<your_Hyperscience_URL> SAML_METADATA_URL=https://<your_domain>.okta.com/app/<app_ID>/sso/saml/metadata SAML_ADMIN_PERMISSION_ROLE=admin_group
Troubleshooting
For the purpose of troubleshooting, you can enable SAML debug mode. When this mode is enabled, the system produces detailed log entries with requests, assertions, and other data. To enable debug mode, enter the following in the ".env" file:
SAML_DEBUG=true
SaaS instances
The steps required to integrate your SAML IdP with Hyperscience depend on the version of Hyperscience you’re running.
New deployments of v38 and later
If you want to integrate your SAML IdP with Hyperscience, you can set up and manage that integration in the Hyperscience application.
Prerequisites
Before starting the setup process, ensure that you have:
- Communicated to your Hyperscience representative that you want to manage your SAML setup in your application
- Added at least one user record to your SAML authentication provider
Integrating your IdP with Hyperscience
- In your IdP, create an application. Hyperscience will use this application to connect to your IdP.
- In your IdP, create at least one user group for Hyperscience administrators and assign a user to it. You need this group name for the next steps.
- In the Hyperscience application, go to the System Settings page ( Administration > System Settings), and in the View drop-down menu at the top of the page, click on Security & Identity.
- In the Identity Provider card, click Edit.
- Select the Enabled checkbox.
- In the Identity Provider Name field, enter a name for the IdP.
- In the Identity Provider Organization field, enter a name for the main point of contact for the IdP at your organization.
- Click on SAML.
- Enter the requested information in the top five fields. The first two fields are required, and either the third or fourth field is also required, depending on your preferred configuration.
- In the bottom six fields ( Username Field Name on the SAML Data up to and including Staff Groups on the IdP Side (Comma Separated: GroupA,GroupB)), enter the requested field mappings from your IdP to Hyperscience. This information can be obtained from the metadata XML from the IdP.
- Select the checkboxes for any of the optional settings you would like to apply to your integration.
- Click Show Hyperscience configuration for selected identity provider.
- Copy the information from the Information to use with your identity provider window that appears, and paste it into the respective fields in your IdP.
- Click Save at the top of the Identity Provider card.
- Create additional groups in your IdP for non-admin users, and map them to their Hyperscience roles by following the instructions in Adding an authentication group.
v37 and earlier / Upgrades to v38
You can integrate your SAML authentication provider with Hyperscience by providing the following information to your Hyperscience representative:
- The SAML group name for users accessing the Hyperscience instance
- The SAML group name for users who should be in the “System Admin” permission group in Hyperscience
- IdP metadata
- SAML SSO URL
- SAML username assertion
- Should SP sign SAML requests sent to the IdP? (yes/no)
- Should IdP sign requests sent to the SP? (yes/no)
After we receive this information, we will set up the integration with your IdP and Hyperscience.