LDAP Authentication

Introduction

OneAccess supports user identity authentication and permission control over LDAP.

  • LDAP can be considered a tree-like database that stores user and organization information.
  • One of the main application scenarios of LDAP is SSO where users are automatically logged in to internal networks of their company after logging in on a PC for once.
Table 1 Terms

Term

Description

OU

Organization unit (OU), which is a container object.

DC

Domain component (dc), which is a part of a domain name. A domain name is divided into several parts.

SN

Short for surname.

CN

Short for common name.

DN

Short for distinguished name. A dn must be unique.

UID

Short for user ID.

RDN

Relative distinguished name (RDN) is similar to the relative path in a file system.

This section describes how to integrate LDAP with OneAccess.

The procedure for accessing the user portal on a PC is used for illustration. Select and configure an application that meets your service requirements.

Configuration Process

Figure 1 Configuration process

Prerequisites

You have permissions to access the administrator portal.

Setting Up an LDAP Server

  1. Download the Directory Services installation package at the ForgeRock official website.
  2. Deploy the LDAP service. For details, see the documentation of the ForgeRock platform.

Configuring LDAP Connection

  1. Download and install ApacheDirectoryStudio, an LDAP client.
  2. Choose LDAP > New Connection and set the connection parameters.

    Figure 2 Creating a connection

  3. Add an account in LDAP.

    Figure 3 Viewing users

Adding an LDAP Authentication Provider

LDAP has three authentication modes: DN authentication, query authentication, and DN and query authentication.

  • DN authentication: Select this authentication mode if you know the user DN rules. For example, uid=**, ou=people, dc=example, dc=com. In this mode, you only need to configure the user DN mode.
    Figure 4 DN authentication mode
  • Query authentication: When selecting this mode, configure the LDAP administrator account and password and set the query conditions. During authentication, the LDAP administrator account is used to query a user based on the configured conditions and entered username. After a matched user is found, the DN of the user is obtained, and the DN and password of the user are verified in LDAP.
    Figure 5 Query authentication mode
  • DN and query authentication: In this authentication mode, DN takes precedence over the query conditions.
    Figure 6 DN and query authentication

The following is the procedure for configuring DN and query authentication of LDAP.

  1. Log in to the administrator portal.
  2. In the top navigation pane, choose Authentication > Authentication Providers. Then click LDAP.

    Figure 7 Clicking LDAP

  3. On the LDAP Authentication Providers page, click Add Authentication Provider in the upper right corner and set the parameters required.

    Figure 8 Configuring parameters
    Table 2 Configuration parameters

    Parameter

    Mandatory

    Description

    Display Name

    Yes

    Display name of the authentication provider, for example, LDAP.

    LDAP Address

    Yes

    Connection address of LDAP in the format "ldap://{hostname}:{port}/", where {hostname} indicates the LDAP server address and {port} indicates the port number. The default port is 389. For details, see Setting Up an LDAP Server.

    baseDn

    Yes

    Root node of the LDAP directory used to authenticate users. The format of the value is "dc=,dc=". For details, see Setting Up an LDAP Server.

    Administrator DN

    No

    Identifier of the administrator. The default value is cn=Directory Manager.

    Administrator Password

    No

    Password of the LDAP administrator.

    User Query Base

    No

    Base DN of users. The default value is ou=People.

    User Query Conditions

    No

    Filter conditions for matching system users in LDAP. The default value is (&(objectClass=user)(uid={0})). For details, see LDAP Filters. Condition-based search has lower priority than DN-based query.

    User DN Mode

    No

    Search path of LDAP users. The default value is uid={0},ou=people. DN authentication takes precedence over other authentication modes.

    Source Attribute

    Yes

    LDAP username attribute. The default value is uid. You can obtain the attribute in 3.

    Related User Attribute

    Yes

    User attribute mapped by LDAP in the system. The user attribute must be a unique text.

    No User Associated

    Yes

    Operation that will be performed if a user logs in successfully but fails to be associated with a system user.

    To map other attributes, such as username, set No User Associated to Automatically create users, and add the desired mappings. For details, see Table 3.

    Table 3 Mapping parameters

    Parameter

    Description

    User Attribute

    Attribute in OneAccess that maps to LDAP.

    Mapping Type

    Mode of user attribute mapping between OneAccess and LDAP.

    Authentication Provider Attribute Name

    Name of the corresponding user attribute in LDAP.

Enabling LDAP Authentication

  1. Log in to the administrator portal.
  2. In the top navigation pane, choose Resources > Applications. Then select UserCenter in the Pre-integrated Applications section.
  3. On the application information page, click the application icon.
  4. On the application details page, choose Login Settings > Web Applications, enable LDAP authentication, and select the authentication provider added in Adding an LDAP Authentication Provider.

    The password text box will be used during LDAP authentication. To enable LDAP authentication, disable database authentication and AD authentication first.

Logging In to the User Portal Through LDAP Authentication

  • Go to the user portal login page, select Password, enter an LDAP account and password, and click Log In.
    Figure 9 Selecting Password
  • After login, go to the administrator portal, choose Users > Organizations and Users, and view the automatically created user.
    • To automatically create a new user if the authorized user is not associated with any system user, set No User Associated to Automatically create users. For details, see Table 2.
    • By default, users automatically created in the preceding scenario belong to the first root organization in the administrator portal.
    Figure 10 Viewing users