Skip to content

SAML2 Single Sign-On Authentication (On-Premise Only)

Available for Botium Box version >= 1.13.2

Authentication with SAML2. You will need at least:

  • The SAML SSO URL (Entry Point)
  • The certificate provided by the identity provider

Activation

  • Set the environment variable BOTIUMBOX_PASSPORT_STRATEGY to saml2
  • Add configuration with JSON file and/or other environment variables (see below)
  • Restart Botium Box
  • Download the SAML Service Provider (SP) Metadata file from /api/auth/saml2/metadata and use it to register Botium Box in your indentiy provider - this file looks like this and it is bound to the Botium Box URL:
<?xml version="1.0"?>
<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" entityID="botiumbox-<botium-box-url>" ID="botiumbox_botium_box_url">
  <SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
    <NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</NameIDFormat>
    <AssertionConsumerService index="1" isDefault="true" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="<botium-box-url>/api/auth/saml2/callback"/>
  </SPSSODescriptor>
</EntityDescriptor>

Botium Box will now show an additional option Sign in with Single Sign-On on the Login screen. It is still possible to use the internal Botium Box authentication, which is often used for administrative access.

Configuration with JSON File and Environment Variables

Place a file named saml2.config.json in the resources folder of your Botium Box installation. This is an example:

{
  "options": {
    "entryPoint": "https://sso.jumpcloud.com/saml2/botiumdevlocal",
    "cert": "jumpcloud.pem"
  },
  "autoCreateUser": true,
  "autoCreateRole": "GUEST",
  "propUsername": "nameID",
  "propEmail": "email",
  "propGroups": "memberOf",
  "group2Role": {
    "Administrator": "ADMIN",
    "Manager": "TESTMANAGER",
    "Tester": ["TESTER", "GUEST"]
  },
  "user2Role": {
    "admin": "ADMIN"
  }
}

Note

On first access, Botium Box will read and cache this file. When making changes you have to restart Botium Box.

Passport-SAML Options

The options field is used to initialize the Passport-SAML module, and you will find documentation for all of the possible values in the documentation for this module. Some notes:

  • The option fields holding certificates (cert, privateKey, decryptionPvk) are treated as relative filenames, or they can hold the certificate data itself (one line, no headers/footers)
  • The Botium Box specific connectivity fields (protocol, host, path) are filled automatically and you shouldn't overwrite it without a good reason
  • The issuer is also filled automatically and can be overwritten here

The options field is also read from the environment variable BOTIUMBOX_PASSPORT_SAML2_OPTIONS, overwriting fields from the configuration file.

propUsername

SAML attribute name holding the username (default nameID), which is used to lookup the User records in Botium Box.

Also read from environment variable BOTIUMBOX_PASSPORT_SAML2_PROPERTY_USERNAME

propEmail

SAML attribute name holding the email (default email)

Also read from environment variable BOTIUMBOX_PASSPORT_SAML2_PROPERTY_EMAIL

propGroupNames

SAML attribute name holding the group or role names (default memberOf). They are mapped to Botium Box roles (see below).

Also read from environment variable BOTIUMBOX_PASSPORT_SAML2_PROPERTY_GROUPS

autoCreateUser

A boolean flag to let Botium Box automatically create user records that do not yet exist (default true)

Also read from environment variable BOTIUMBOX_PASSPORT_SAML2_AUTOCREATE_USER ("1" => true)

autoCreateRole

A role name that is automatically assigned to all created user records (default GUEST)

Also read from environment variable BOTIUMBOX_PASSPORT_SAML2_AUTOCREATE_ROLE

group2Role

A mapping from the SAML2 groups or roles to Botium Box roles.

Also read from environment variable BOTIUMBOX_PASSPORT_SAML2_GROUP2ROLE

user2Role

A mapping from the SAML2 user names to Botium Box roles.

Also read from environment variable BOTIUMBOX_PASSPORT_SAML2_USER2ROLE