Skip to main content

This documentation is for an older version of this product. See the latest version of this content.Opens in a new tab

LDAP Authentication

Overview of Setting Up LDAP Authentication

To configure an InterSystems IRIS service or application to use an LDAP server for authentication:

  1. Configure InterSystems IRIS to use the LDAP server:

    1. Enable LDAP and related features for the instance.

    2. Create an LDAP configuration for the instance of InterSystems IRIS. This includes specifying the names of LDAP user properties to be used for setting the values of properties of InterSystems IRIS users.

    3. Optionally, test the LDAP configuration.

    4. Optionally, configure the instance to support multiple LDAP domains.

    5. Set up a role that is required for logging in to the instance.

    6. Enable LDAP for the instance’s relevant services and applications. This involves enabling LDAP for the entire instance of InterSystems IRIS and then enabling it for the relevant services or applications.

Note:

To perform LDAP authentication programmatically, use InterSystems IRIS delegated authentication.

Enable LDAP for an Instance

The first step in configuring an instance of InterSystems IRIS to use LDAP is to enable the features you wish to use:

  1. From the Management Portal home page, go to the Authentication/Web Session Options page (System Administration > Security > System Security > Authentication/Web Session Options).

  2. On the Authentication/Web Session Options page:

    • To enable LDAP authentication, select Allow LDAP authentication.

    • To enable authentication using LDAP cached credentials, select Allow LDAP cache credentials authentication. For more information on this topic, see LDAP Cached Credentials.

  3. Click Save to apply the changes.

LDAP Cached Credentials

If you configure an instance to use LDAP cached credentials, it stores (caches) a copy of the credentials that it most recently used to authenticate each user. If an instance supports cached credentials and it cannot connect to the LDAP server, then it uses the cached LDAP credentials to authenticate users. This can be caused by an issue with the LDAP server itself or with the connection to the server.

To secure cached credentials, InterSystems IRIS stores all LDAP passwords in the security database as a one-way hash. If the instance cannot use the LDAP server to validate the user, it then attempts to confirm that:

  • The hash of the entered password matches the hash of the stored password

  • The cached expiration date from the last LDAP login has not been reached

If both conditions are true, the instance authenticates the user and login proceeds; otherwise, login fails.

Create or Modify an LDAP Configuration

To perform LDAP authentication, InterSystems IRIS uses an LDAP configuration. An LDAP configuration specifies a connection to an LDAP server for a particular security domain and has information required to:

  • Connect to and query the LDAP server

  • Retrieve the required information about the user being authenticated

Note:

If Kerberos is enabled for an instance, all menu items and other labels for LDAP configurations refer to LDAP/Kerberos configurations. The following procedure does not note this in each individual situation.

To create or modify an LDAP configuration:

  1. Go to the Management Portal Security LDAP Configurations page (System Administration > Security > System Security > LDAP Configurations).

    During installation, if you are installing InterSystems IRIS onto a machine that is currently using an LDAP server, InterSystems IRIS creates an LDAP configuration based on that LDAP server’s domain and other configuration information.

  2. Create or modify a configuration:

    • To modify an existing configuration, click its name. For example, if you are using the configuration associated with the local LDAP server, then you may simply wish to check this configuration’s attributes and modify any as needed.

    • To create a configuration, click the Create New LDAP Configuration button. This displays the Edit LDAP configuration page.

      Note:

      When creating a configuration, on the Edit LDAP configuration page, select the LDAP configuration check box if it is available. This displays the fields that define the LDAP configuration.

  3. Modify or complete the fields to define the configuration (listed below).

  4. If you create multiple configurations, you must specify which one is the default on the System-wide Security Parameters page (Security Administration > Security > System Security > System-wide Security Parameters), using the Default security domain drop-down.

LDAP Configuration Fields

An LDAP configuration includes the following fields:

  • Login Domain NameRequired. The name of the LDAP configuration. This is typically in the form of example.com or example.org.

    If you enter a value that does not include a period, the system appends .com to it, so that example becomes example.com. If you enter a value in uppercase, the system puts in lowercase, so that EXAMPLE.COM becomes example.com. The system performs both transformations, if appropriate.

    The system uses the transformed value of the Name field to populate the LDAP Base DN to use for searches field.

  • Description — Any text to describe the configuration.

  • Copy fromAvailable only when creating a configuration. Whether or not InterSystems IRIS copies attributes from an existing LDAP configuration to specify initial values for this one.

  • LDAP Enabled — Whether or not InterSystems IRIS can use the configuration to connect to an LDAP server.

  • LDAP server is a Windows Active Directory serverWindows only. Whether or not the LDAP server is a Windows Active Directory server.

  • LDAP hostnamesRequired. The name(s) of the host(s) on which the LDAP server is running. Separate multiple hostnames using spaces as a delimiter. The complexity of each hostname can range from an unqualified hostname to fully-qualified hostname with a port number; the required form of the hostname(s) depends on the particular configuration.

    If the LDAP server is configured to use a particular port, you can specify it by appending “:portname” to the hostname; typical usage is not to specify a port and to let the LDAP functions use the default port. You can specify the domain example.com as your hostname if you have multiple replicated domain servers on your network like:

    ldapserver.example.com
    ldapserver1.example.com
    ldapserver2.example.com
    ldapserver3.example.com
    

    LDAP performs a DNS query for the addresses of all the matching LDAP servers and then automatically selects one to connect to.

    Important:

    Including a port number in the value of LDAP hostnames affects the TLS behavior when establishing a connection:

    • If the value specified contains a port number other than 636, such as ldapserver.example.com:389 and the Use TLS/SSL encryption for LDAP sessions check box is selected, then the instance attempts to establish a plaintext connection to the LDAP server and then issue a StartTLS command to encrypt the connection.

    • If the value specified for LDAP hostnames contains the port number 636, such as ldapserver.example.com:636, then the instance attempts to establish a TLS connection with the LDAP server directly—whether or not the Use TLS/SSL encryption for LDAP sessions check box is selected. Note, however, that connecting directly to port 636 from UNIX® client instances is not supported.

    For background, see the class reference for the %SYS.LDAP.Init()Opens in a new tab method.

  • LDAP search information — varies by circumstances:

    • LDAP username to use for searchesFor Windows Active Directory servers only. Required if available. The user name provided to the LDAP server to establish an initial connection and which is used to perform LDAP searches and lookups. This user is also known as the search user.

      The search user must have permission to read the entire LDAP database. It is important to ensure that the search user has uninterrupted access to the LDAP database. For example, the user’s LDAP account should be set so that:

      • The user cannot change the account’s password

      • The password never expires

      • The account never expires

      For more information on searching the LDAP database, see How LDAP Looks Up the Target User in Its Database.

    • LDAP search user DNFor all non-Windows platforms and Windows non-Active Directory servers. Required if available. The Distinguished Name (DN) of the user provided to the LDAP server to establish an initial connection and which is used to perform LDAP searches and lookups. This user is also known as the search user.

      The search user must have permission to read the entire LDAP database. It is also important to ensure that the search user has uninterrupted access to the LDAP database. For example, the user’s LDAP account should be set so that:

      • The user cannot change the account’s password

      • The password never expires

      • The account never expires

      For example, if the search user is “ldapsearchuser”, the LDAP DN (distinguished name) might be as follows:

      uid=ldapsearchuser,ou=People,dc=example,dc=com 
      

      For more information on searching the LDAP database, see How LDAP Looks Up the Target User in Its Database.

  • LDAP username passwordAvailable only when creating or modifying a configuration. The password associated with the account used for the initial connection.

  • LDAP Base DN to use for searchesRequired. The point in the directory tree from which searches begin. This typically consists of domain components, such as DC=example,DC=com.

  • LDAP Base DN for Groups to use for searchesRequired. The point in the directory tree from which searches for nested groups begin. This typically consists of organizational units and domain components, such as OU=IRIS,OU=Groups,DC=test,DC=com. By default, this is set to the same value as LDAP Base DN to use for searches.

  • LDAP Unique search attributeRequired. A unique identifying element of each record, which therefore makes it appropriate for searches. For more information on searching the LDAP database, see How LDAP Looks Up the Target User in Its Database.

  • Use TLS/SSL encryption for LDAP sessions — Whether or not the InterSystems IRIS instance and the LDAP server encrypt their communications using TLS (disabled by default).

    Important:

    InterSystems recommends that you enable TLS encryption for LDAP.

    For connections to Active Directory servers, note the following:

    • When enabled for an LDAP connection from an instance on Windows to an Active Directory server, the connection uses port 636 (which is a TLS-encrypted port).

    • When enabled for an LDAP connection from an instance on UNIX® to an Active Directory server, InterSystems IRIS first establishes the connection on port 389 (the unencrypted LDAP port); encryption is then turned on by a StartTLS call.

    InterSystems also recommends setting the LDAP server signing requirements parameter to Require signature on the Active Directory Server. This prevents any LDAP bind command on the server on port 389 to be executed unless the channel is encrypted with StartTLS. For more information, see Domain Controller: LDAP Server Signing RequirementsOpens in a new tab article on the Microsoft web site.

  • File with Certificate Authority certificate(s) to authenticate the LDAP serverUNIX® only. The location of the file containing any TLS certificates (in PEM format) being used to authenticate the server.

    On Windows, to specify the location of a file containing any TLS certificates (in PEM format) being used to authenticate the server certificate to establish a secure LDAP connection, use Microsoft Certificate ServicesOpens in a new tab. Certificates must be installed in the Certificates (Local Computer)\Trusted Root Certification Authorities certificate store.

  • Allow ISC_LDAP_CONFIGURATION environment variable — If you are using OS-based LDAP and multiple domains, specifies whether or not to use the ISC_LDAP_CONFIGURATION environment variable. If the environment variable is defined, then OS-based LDAP uses it to determine which LDAP configuration to use for authentication.

  • Use LDAP Groups for Roles/Routine/Namespace — Whether or not the user’s roles, routine, and namespace come from the user’s group memberships (true by default); if not, then they come from the attribute fields of the user’s LDAP record. If you select this field, the system enables and disables other fields (see each subsequent field for details).

    Note:

    InterSystems recommends the use of LDAP groups for authorization, rather than LDAP attributes (including InterSystems registered LDAP properties). If you have existing code or are otherwise required to use registered properties, see Configure Authorization with LDAP Attributes for details.

  • Search Nested Groups for Roles/Routine/NamespaceOnly active if LDAP server is a Windows Active Directory server and Use LDAP Groups for Roles/Routine/Namespace are selected. Whether or not search returns all of a user’s nested groups. See Nested Groups for more information on nested groups.

  • Organization ID prefix for group namesOnly active if Use LDAP Groups for Roles/Routine/Namespace is selected. See LDAP Group Name Configuration for more information.

  • Allow Universal group AuthorizationOnly active if Use LDAP Groups for Roles/Routine/Namespace is selected. Whether or not searches use the attributes on the LDAP server that are relevant for all InterSystems IRIS instances. See Create Universal LDAP Authorization Groups for more information.

  • Authorization Group IDOnly active if Use LDAP Groups for Roles/Routine/Namespace is selected. The multiple-instance group to which this instance belongs. See Create LDAP Authorization Groups for Multiple Instances (Multiple-Instance Groups) for more information.

  • Authorization Instance IDOnly active if Use LDAP Groups for Roles/Routine/Namespace is selected. The single-instance group to which this instance belongs. See Create LDAP Authorization Groups for a Single Instance (Single-Instance Groups) for more information.

  • User attribute to retrieve default namespace (not active if LDAP groups are selected) — The attribute whose value is the source for the Startup namespace property for a user. This property of an InterSystems IRIS user is described in User Account Properties; this LDAP property is described in Configure Authorization with LDAP Attributes.

  • User attribute to retrieve default routine (not active if LDAP groups are selected) — The attribute whose value is the source for the Tag^Routine property for a user. This property of an InterSystems IRIS user is described in User Account Properties; this LDAP property is described in Configure Authorization with LDAP Attributes.

  • User attribute to retrieve roles (not active if LDAP groups are selected) — The attribute whose value determines the roles to which a user is assigned. When creating this attribute, it must be specified as an LDAP multivalued attribute. For information about an InterSystems IRIS user’s roles, see the Roles tab of a user’s Edit User page; this LDAP property is described in Configure Authorization with LDAP Attributes.

  • User attribute to retrieve comment attribute — The attribute whose value is the source for the Comment property for a user. This property is described in User Account Properties. Once a user has logged in, you can retrieve the value of this property using the Security.Users.Get() method.

  • User attribute to retrieve full name from — The attribute whose value is the source for the Full name property for a user. This property is described in User Account Properties. Once a user has logged in, you can retrieve the value of this property using the Security.Users.Get() method.

  • User attribute to retrieve mail address — The attribute whose value is the source for the Email address property for a user. This property is described in User Account Properties. Once a user has logged in, you can retrieve the value of this property using the Security.Users.Get() method.

  • User attribute to retrieve mobile phone — The attribute whose value is the source for the Mobile Phone Number property for a user. This property is described in User Account Properties. Once a user has logged in, you can retrieve the value of this property using the Security.Users.Get() method.

  • User attribute to retrieve mobile provider from — The attribute whose value is the source for the Mobile Phone Service Provider property for a user. This property is described in User Account Properties. Once a user has logged in, you can retrieve the value of this property using the Security.Users.Get() method.

  • LDAP attributes to retrieve for each user — Any attributes whose values are the source for any application-specific variables. Application code can then use the Get method of the Security.UsersOpens in a new tab class to return this information.

The values of the fields of an LDAP configuration are stored in an instance of the Security.LDAPConfigsOpens in a new tab class.

Note on LDAP/Kerberos Configuration Fields

If Kerberos authentication is enabled for an instance, then the page for creating an LDAP configuration is Edit LDAP/Kerberos configurations page. It has the same fields as the Edit LDAP configurations page, as described in LDAP Configuration Fields.

Test an LDAP Configuration

Once you have created an LDAP configuration, you can test it. This allows you to confirm that it properly connects to the LDAP server or troubleshoot any issues that arise. To test a configuration:

  1. In the Management Portal, go to the Security LDAP Configurations page (System Administration > Security > System Security > LDAP Configurations).

  2. Click Test LDAP Authentication.

  3. In the Username and Password fields, enter a valid username and password defined on the LDAP server. If the instance is configured to use multiple domains, you must provide a fully qualified username, such as EndUser@example.com; if the instance is using only a single domain, simply enter the unqualified username (without the @ symbol or the domain name), such as EndUser.

  4. Click Test.

The Test Results field displays output from the LDAP server.

Note:

This feature only tests if an instance can connect to an LDAP server and perform authentication checks for the entered user. It does not perform any authorization or permission checks to determine if the user can successfully log in to the system.

If the test succeeds for the entered user, but the user cannot log in, then check the audit record for the login failure. To ensure successful login, you may need to give additional permissions to the user.

Use Multiple LDAP Domains

InterSystems IRIS supports LDAP authentication with multiple domains. This allows the instance to have user accounts that include the same username from more than one domain, such as EndUser@example.com and EndUser@otherexample.com. This feature can be useful in multiple scenarios. For example:

  • It allows merging distinct sets of users from multiple domains into one larger group while preserving unique identifiers for each user.

  • It allows the same individual to have accounts on multiple domains with varying privileges for each.

To use multiple domains:

  1. Create additional LDAP configurations according to the instructions in Create or Modify an LDAP Configuration.

  2. Configure the instance to use multiple domains and then specify a default domain:

    1. Enable the use of multiple domains for the instance. In the Management Portal, on the System-wide Security Parameters page (System Administration > Security > System Security > System-wide Security Parameters), select the Allow multiple security domains check box.

    2. Specify a default domain. In the Management Portal, on the System-wide Security Parameters page (System Administration > Security > System Security > System-wide Security Parameters), select a default domain using the Default security domain drop-down.

    3. Click Save.

    For more information about this page, see System-Wide Security Parameters.

Note:

Even if you are using multiple domains, the name for each user must be unique, even if they are of different types. Hence, if you create a user such as EndUser@example.com that is a password user, you cannot then log in to InterSystems IRIS through LDAP as the user EndUser@example.com, as InterSystems IRIS cannot create the account for EndUser@example.com as an LDAP user.

Set Up a Required Login Role

If you have multiple instances of InterSystems IRIS and are using LDAP authentication or OS-based authentication with LDAP authorization, then InterSystems strongly recommends that each instance have a role that is required for the users who are connecting to it. This mechanism prevents users from accessing instances where they are insufficiently privileged; otherwise, a user who holds various roles on one instance may then have those same roles on an instance where this is not intended.

To set up a required login role:

  1. For each instance, if the role to be required does not already exist, create it according to the instructions in Create Roles.

  2. For each instance, specify the required role in the Role required to connect to this system field on the System Security Settings page (System Administration > Security > System Security > System-wide Security Parameters).

  3. Add an LDAP group with a name that includes the name of the required role. The name of the group is of the form:

    intersystems-Instance-instanceID-Role-rolename

    where:

    • instanceID is the unique identifier for the instance on the LDAP server

    • rolename is the name of the role required to connect

Note:

In certain circumstances, such as with mirroring, you may prefer to have a single required login role among multiple instances.

For example, suppose there are two systems, TEST and PRODUCTION. To secure each of these systems, create a role on TEST called TESTACCESS and a role on PRODUCTION called PRODUCTIONACCESS. On TEST, set the value of the Role required to connect to this system field to TESTACCESS; on PRODUCTION, set it to PRODUCTIONACCESS. Then, if a user is only allowed to access the TEST system, assign that user the TESTACCESS role only and do not assign the PRODUCTIONACCESS role to the user. For users who can access either system, assign them both PRODUCTIONACCESS and TESTACCESS roles.

Enable LDAP for Services and Applications

After enabling LDAP authentication for the instance, enable it for the instance’s relevant services or applications:

  1. Because LDAP authentication is enabled for the instance, an LDAP check box appears on the Edit Service page for the services that support LDAP authentication and the Edit Web Application page for web applications.

  2. Enable LDAP authentication for services and applications as appropriate.

The following services support LDAP authentication:

  • %Service_Bindings

  • %Service_CallIn

  • %Service_ComPort

  • %Service_Console

  • %Service_Login

  • %Service_Terminal

  • %Service_Telnet

  • %Service_WebGateway

These fall into several categories of access modes:

  • Local Access

    %Service_CallIn, %Service_ComPort, %Service_Console, %Service_Login, %Service_Terminal, %Service_Telnet

    To use LDAP authentication with local connections, enable it for the service.

  • Client-Server Access

    %Service_Bindings

    To use LDAP authentication with client-server connections, enable it for the service.

  • Web Access

    %Service_WebGateway

    To allow named users to log in to web applications using LDAP authentication, you will have to enable the relevant web applications to use LDAP. See Security Settings in “Defining Applications” for more information about adding authentication mechanisms to a web application. Enabling LDAP authentication for the service also allows the Web Gateway itself to authenticate using LDAP authentication.

The State of an Instance After LDAP Authentication

Any user who is initially authenticated using LDAP authentication is listed in the table of users on the Users page (System Administration > Security > Users) as having a Type of “LDAP user”. If a system administrator has explicitly created a user through the Management Portal (or using any other native InterSystems IRIS facility), that user has a type of “InterSystems IRIS password user”. If a user attempts to log in using LDAP authentication and is successfully authenticated, InterSystems IRIS determines that this user already exists as an InterSystems IRIS user — not an LDAP user — and so login fails.

View an LDAP Configuration in the Portal As %Operator

If you are logged in to the Management Portal as a user who has the %Operator role or the %Admin_Operate:Use privilege, you can view (but not edit) the instance’s LDAP configurations:

  1. In the Portal, go to the LDAP Configurations page (System Operation > LDAP Configurations).

  2. On that page, click on the name of the configuration you wish to view, which displays the Display LDAP Configuration for that configuration.

To edit an LDAP configuration, go to the Security LDAP Configurations page (System Administration > Security > System Security > LDAP Configurations); you must have the %Admin_Secure:Use privilege.

The Security LDAP Configurations Page

The Portal’s Security LDAP Configurations page (System Operation > LDAP Configurations) displays a list of the instance’s LDAP configurations. Click the name of a configuration to view its properties. If Kerberos authentication is enabled for the instance, this is called the Security LDAP/Kerberos configurations page (System Operation > LDAP/Kerberos configurations).

FeedbackOpens in a new tab