LDAP Directory Manager

Introduction

The LDAP Directory Manager allows you to integrate Joget with your existing AD/LDAP server. The enhanced LDAP Directory Manager implements all methods on the Joget Directory Manager class. In other words, it has been made possible to list and navigate through user, department and group entities in Joget itself. This plugin will allow you to seamlessly manage your Active Directory(AD) within Joget apps. You will achieve these once you configured this plugin.
  • AD users can login with their AD username & password in Joget apps.
  • AD user data not stored inside dir_user table.
    • All user-data related operations will query the AD
  • Able to view AD users in Joget user management in READONLY mode
  • AD user credentials are managed outside of Joget's control
    • via preferred LDAP browser
  • Local users can still login, if valid credentials exist in dir_user table.
  • MFA (Multi Factor Authentication) cannot be turned on because there is no SEDM ( Security Enhanced Directory Manager).
Warning
Do not lock yourself out when you are configuring any Directory Manager plugin. Keep your browser session open and perform the actual test in other machine/browser so that in case of any wrong configurations used, you can still continue to make amends.

In case you have a misconfiguration and cannot login, you can make use of the credential set during configuration ( Admin Username (Principal) & Admin Password (Credential) ) to login as the administrator.

Troubleshoot
If you forgot all the details during LDAP or any Security Enhanced Directory Manager configuration and you have Locked yourself out,  use this workaround :

To disable your LDAP plugin, get into the database

  1. Remove the password column value in dir_user
    Replace the password column value with new value: admin
  2. In wf_setup >delete any directory manager records
    Remove the 2 rows that start with directoryManager.
    Then, Joget Workflow will fallback to the default directory manager again.

Once you are ready to reconfigure a new LDAP within Joget, turn on Debug Mode when configuring your LDAP and test using other browsers so that you don't lock yourself out again.

The LDAP Directory Manager has a Debug Mode (option in the last tab) which is highly recommended to be turned on when configuring the LDAP plugin for the first time or when you are having issues. When debug mode is on, you can find all the search queries performed by the directory manager. They will all be logged into the joget.log files. From there, you can observe the search filter string and improve the accuracy and performance of the lookup. You can remove the debug checkbox once everything is running well.

User license determines how many eventual users (sorted alphabetically by username in ascending order) from your LDAP/AD who can login to Joget. Make sure that you configure the plugin accordingly.

As for the 3 users limitation with trial license, you will need to remove all the other users until your test user can be at the top 3 spot in the user list.

Configure LDAP directory manager

Fields to configure: 

  • URL: 
    • ldap://IP_ADDRESS:389
    • ldaps://IP_ADDRESS:636
  • Admin Username (Principal): LDAP username with read permission to LDAP/AD.
    Example: cn=admin,dc=joget,dc=org
  • Admin Password (Credential): admin
  • Root DN: DC=joget,DC=org

User

Fields to configure:

  • User Base DN: Set the user base DN property.
    Tips
    If you set the User Base DN to your LDAP Root DN, it means that the search will start from the Root DN until it finds all the results that match the search filter.
    So, setting the User Base DN precisely is very important as it will decide where the search is starting from. It will save all the unnecessary searches between the Root DN and your User Base DN.

    Root DN
    DC=joget,DC=org
    Under the Root DN, you have the following DN:
    DC=HR,DC=joget,DC=org
    DC=Product Department,DC=joget,DC=org
    DC=Operation,DC=joget,DC=org
    DC=Users,DC=joget,DC=org
    If your users are all under DC=Users, DC=joget,DC=org, you should set this to User Base DN.
    By doing this, it will not go through all the other entries and their child entries before reaching DC=Users, DC=joget,DC=org.
  • User Import Search Filter: (objectClass=person)
    Tips
    Value
    (&(objectClass=person)(|(cn=admin)(cn=cat)(cn=jack)(cn=john)(cn=jackie)))
    This means all the LDAP entries that have objectClass attribute equal to person and cn attribute equal to either admincatjackjohn or jackie are Joget users.
    So, when the admin performs a login, the search filter will add an additional filter and become (&(&(objectClass=person)(|(cn=admin)(cn=cat)(cn=jack)(cn=john)(cn=jackie)))(cn=admin))
    You will notice that an extra (cn=admin) is added to the search filter to ensure it returns only the admin user.

    User License

    User license determines how many eventual users (sorted alphabetically) from your LDAP/AD can log in to the system. You can use this attribute to control the number of users returned from your LDAP.

    For the trial license, there is a 3-user limitation: if you would like to perform tests on several test users, you will need to remove all the other users until your test user can be in the top 3 spots in the user list. See LDAP User Management.

  • Attribute Mapping - Username: cn
  • Attribute Mapping - First Name: givenName
  • Attribute Mapping - Last Name: sn
  • Attribute Mapping - Email: mail
  • Attribute Mapping - Status: status
  • Attribute Mapping - Time Zone: 8
  • Attribute Mapping - Locale: en_US

Employment

Fields to configure:

  • Attribute Mapping - Employee Code
  • Attribute Mapping - Job Title 
  • Attribute Mapping - Report To 
  • Map To "Report To" Entry Attribute
  • Attribute Mapping - Groups
  • Map To LDAP Group Entry Primary Attribute: dn
    DN
    A distinguished name (usually just shortened to “DN”) uniquely identifies an entry and describes its position in the DIT. ... DNs are comprised of zero or more comma-separated components called relative distinguished names, or RDNs.
    Directory Service DN Entity Name
    OpenLDAP entryDN
    Microsoft AD distinguishedName
  • Attribute Mapping - Departments
  • Map To LDAP Department Entry Primary Attribute: dn
  • Attribute Mapping - Grade
  • Map To LDAP Grade Entry Primary Attribute: dn
  • Attribute Mapping - Metas: Additional attributes to retrieve using #user.USERNAME.meta.KEY# or #currentUser.meta.KEY#.
    Name Description
    Key Key name
    Attribute Attribute name in LDAP

Group

Fields to configure: 

  • Group Base DN
  • Group Import Search Filter: (objectClass=groupOfNames)
    See LDAP Search Filter syntax.
  • Attribute Mapping - ID: cn
  • Attribute Mapping - Name: description
  • Attribute Mapping - Description: description
  • Attribute Mapping - Users: member
  • Map To LDAP User Entry Primary Attribute: dn

Department

Fields to configure: 

  • Department Base DN
  • Department Import Search FilterobjectClass=groupOfNames)
    See LDAP Search Filter syntax.
  • Attribute Mapping - ID: cn
  • Attribute Mapping - Name: description
  • Attribute Mapping - Description: description
  • Attribute Mapping - HOD: owner
  • Attribute Mapping - Users: member
    Tips
    If the department object itself contains the users that belong to the department, define the attribute name here. For example, in the figure below, we can define "member" as the value here. There's no need to define anything else in "Employment" tab earlier for this case.
  • Map To LDAP User Entry Primary Attribute: dn

Grade

Name
Value
Grade Base DN
 
Grade Import Search Filter
Please refer to other LDAP Search Filter syntax.
Attribute Mapping - ID
 
Attribute Mapping - Name
 
Attribute Mapping - Description
 
Attribute Mapping - Users
 
Map To LDAP User Entry Primary Attribute
 

Admin Role

Name
Value

Admin Role Base DN

 

Admin Role Import Search Filter

(&(objectClass=person)(cn=admin))

Please refer to other LDAP Search Filter syntax.

Attribute Mapping - Users

cn

Map To LDAP User Entry Primary Attribute

 dn

Mapping admin_role from your LDAP is as follows:

  1. Create a new organizational unit in your LDAP. For example, the new ou is ou=adminrole,dc=example,dc=org.
  2. Create cn entries of usernames who have the admin role in Joget. The usernames must exist in your users' ou=people,dc=example,dc=org property.
  3. 3. In Joget LDAP Directory Manager configuration, set the properties accordingly.
    Below is an example but it will differ from everyone else because each organization's LDAP is different:
    • Admin Role Base DN: ou=adminrole,dc=example,dc=org
    • Admin Role Import Search Filter: (objectClass=person)
    • Attribute Mapping - Users: cn
    • Map To LDAP User Entry Primary Attribute: uid ( Set this to the same attribute you used in User 
    • Attribute Mapping - Username" [Tab 2])
  4. Open incognito mode in your favorite browser and log in to Joget to test the new username with the admin role. Leave your main browser open in Configure LDAP Directory Manager in case you need to make some changes.
  5. Go to Setup User and click on your test username to view the user profile information. You should see "Role(s): ROLE_USER, ROLE_ADMIN".
  6. Enable Debug Mode to check for errors, below is the correct setting:
    INFO org.joget.plugin.ldap.DirectoryManagerLDAPImpl - URL: ldap://localhost:389__Admin Username: cn=admin,dc=example,dc=org__Root DN: dc=example,dc=org__User Base DN: ou=people,dc=example,dc=org__Group Base DN: __Department Base DN: __Grade Base DN: __Role Admin Base DN: ou=adminrole,dc=example,dc=org
    

You have to keep trying various configurations until you succeed

Advanced

Name
Value
Result Size Per Paged Search 
100
Debug Mode

Click checkbox to enable helpful debugging messages in your Joget logs.

Configuring the user import search filter

The following articles might be useful to you in understanding how to filter users based on the groups in LDAP:

You can use the pipe symbol '|' to denotes 'OR' and include a second (or more) search parameters, for example:

(|(objectClass=person)(objectClass=user))

Created by Marcos Last modified by Aadrian on Dec 13, 2024