Skip to main content

Authentication modes

CMDBuild supports delegating authentication to external services. This applies to account verification (username and password) only — profiles and permissions are still managed within CMDBuild through the group to which the user belongs.

Authentication settings can be managed via REST commands. Use editconfig to open a GUI showing all available configurations (when CMDBuild is running locally), or use setconfig / setconfigs to apply settings directly from the command line. Example:

cmdbuild.sh restws setconfig org.cmdbuild.auth.case.insensitive true

Configuration of the authentication type

CMDBuild supports the following authentication methods:

  • Default authentication — credentials stored in the database or verified via LDAP
  • SSO CAS authentication
  • SSO SAML authentication
  • OAuth2 authentication

The following additional methods are also available:

  • RSA authentication
  • Header authentication
  • Custom login — similar to header authentication, with the addition of a control script

From version 3.4 onwards, multiple authentication modules can be configured simultaneously using the following configuration schema:

ConfigTypeDescription
org.cmdbuild.auth.modulesStringComma-separated list of auth module names
org.cmdbuild.auth.modules.{ModuleName}.typeStringAuthentication type for the specified module
org.cmdbuild.auth.modules.{ModuleName}.descriptionStringModule description, shown on the login button
org.cmdbuild.auth.modules.{ModuleName}.enabledBooleanEnables or disables the module
org.cmdbuild.auth.modules.{ModuleName}.hiddenBooleanIf true, the module is not shown on the login page and can only be triggered by passing cm_login_module in the request
org.cmdbuild.auth.modules.{ModuleName}....StringAdditional module-specific configurations

The type parameter accepts the following values: default, cas, saml, oauth2.

CAS configuration

ConfigTypeDescription
org.cmdbuild.auth.module.cas.server.urlStringCAS server URL
org.cmdbuild.auth.module.cas.login.pageStringCAS login page URL
org.cmdbuild.auth.module.cas.service.paramStringCAS service parameter
org.cmdbuild.auth.module.cas.ticket.paramStringCAS ticket parameter

SAML configuration

ConfigTypeDescription
org.cmdbuild.auth.module.saml.handlerScriptStringSAML authentication response handler script
org.cmdbuild.auth.module.saml.idp.certStringIdP certificate
org.cmdbuild.auth.module.saml.idp.idStringIdP ID URL
org.cmdbuild.auth.module.saml.idp.loginStringIdP login URL
org.cmdbuild.auth.module.saml.idp.logoutStringIdP logout URL
org.cmdbuild.auth.module.saml.logout.enabledBooleanEnables IdP logout
org.cmdbuild.auth.module.saml.requireSignedAssertionsBooleanRequires signed assertions
org.cmdbuild.auth.module.saml.requireSignedMessagesBooleanRequires signed messages
org.cmdbuild.auth.module.saml.signatureAlgorithmStringSignature algorithm URL
org.cmdbuild.auth.module.saml.sp.baseUrlStringService provider base URL
org.cmdbuild.auth.module.saml.sp.certStringService provider certificate
org.cmdbuild.auth.module.saml.sp.idStringService provider ID URL
org.cmdbuild.auth.module.saml.sp.keyStringService provider private key
org.cmdbuild.auth.module.saml.strictStringEnables strict validation

OAuth2 configuration

ConfigTypeDescription
org.cmdbuild.auth.module.oauth.clientIdStringOAuth client ID
org.cmdbuild.auth.module.oauth.clientSecretStringOAuth client secret
org.cmdbuild.auth.module.oauth.login.attrStringOAuth login attribute matched against CMDBuild users
org.cmdbuild.auth.module.oauth.login.typeStringLogin type matching (username or email)
org.cmdbuild.auth.module.oauth.logout.enabledBooleanEnables OAuth logout
org.cmdbuild.auth.module.oauth.logout.redirectUrlStringLogout redirect URL
org.cmdbuild.auth.module.oauth.protocolStringOAuth protocol (e.g. msazureoauth2)
org.cmdbuild.auth.module.oauth.redirectUrlStringLocal URL accepted by the provider
org.cmdbuild.auth.module.oauth.resourceIdStringOAuth resource ID
org.cmdbuild.auth.module.oauth.scopeStringOAuth scope
org.cmdbuild.auth.module.oauth.serviceUrlStringOAuth service URL
org.cmdbuild.auth.module.oauth.tenantIdStringOAuth tenant ID

LDAP configuration

ConfigTypeDescription
org.cmdbuild.auth.ldap.server.addressStringLDAP server address
org.cmdbuild.auth.ldap.server.urlStringLDAP server URL — if set, overrides host, port and SSL config; multiple URLs can be specified separated by a space
org.cmdbuild.auth.ldap.server.portIntegerLDAP server port
org.cmdbuild.auth.ldap.basednStringBase DN for user queries
org.cmdbuild.auth.ldap.bind.attributeStringUser bind attribute
org.cmdbuild.auth.ldap.followReferralsBooleanEnables following LDAP referrals
org.cmdbuild.auth.ldap.search.auth.methodStringAuth method (none, simple, strong)
org.cmdbuild.auth.ldap.search.auth.passwordStringAuth password
org.cmdbuild.auth.ldap.search.auth.principalStringAuth principal
org.cmdbuild.auth.ldap.search.filterStringSearch filter
org.cmdbuild.auth.ldap.use.sslBooleanEnables SSL
org.cmdbuild.auth.ldap.use.tlsBooleanEnables TLS

General configuration

ConfigTypeDescription
org.cmdbuild.auth.case.insensitiveBooleanEnables case-insensitive login
org.cmdbuild.auth.loginAttributeModeStringLogin attribute mode (username, email, auto_detect_email)
org.cmdbuild.auth.loginServiceReturnSessionIdStringReturn session ID at login (auto, always)
org.cmdbuild.auth.logoutRedirectStringLogout redirect URL
org.cmdbuild.auth.maxLoginAttempts.countIntegerMaximum number of failed login attempts
org.cmdbuild.auth.maxLoginAttempts.windowIntegerTime window in seconds for login attempt counting
org.cmdbuild.auth.preferredPasswordAlgorythmStringPassword encryption algorithm (legacy, cm3easy, cm3)
org.cmdbuild.auth.users.expireInactiveAfterPeriodISO 8601Inactivity period after which a user account expires

Configuring LDAP authentication

This section describes how to configure LDAP authentication for CMDBuild.

For permission management to work correctly, every user authenticating via LDAP must also exist as a user within the CMDBuild webapp.

For example, to allow an LDAP user with UID j.doe to access CMDBuild as a member of the Technicians group, perform the following steps:

  1. Create the user j.doe in CMDBuild with a default password (this does not need to match the LDAP password)
  2. Create the Technicians group in CMDBuild and define the relevant permissions
  3. Add j.doe to the Technicians group

When j.doe logs in, their credentials are verified against the LDAP directory using the authentication chain defined in auth.modules.

Single Sign-On configuration via CAS

This section describes how to configure Single Sign-On (SSO) in CMDBuild using CAS.

The authentication flow works as follows:

  1. The user requests the CMDBuild URL
  2. The CAS authenticator redirects the request to the CAS server (${cas.server.url} + ${cas.login.page}), passing the CMDBuild access URL as the ${cas.service.param} parameter
  3. The CAS server responds with a ticket (via the ${cas.ticket.param} parameter), from which the username is extracted
  4. If the username is successfully validated, CMDBuild proceeds with the login

As with LDAP authentication, every user authenticating via CAS must also exist as a user within the CMDBuild webapp.