LDAP Login Actions
Configuring a a form to use LDAP Login actions for authentication
LDAP Authentication integration provides the ability to authenticate users directly against an LDAP service such as OpenLDAP or Active Directory. The LDAP Login action connects the Username and Password credentials from the form to the LDAP directory.

Settings
Username Field: The Username field from the form mapped to the username field from the LDAP directory
Password Field: The Password field from the form mapped to the username field from the LDAP directory
Passthrough: If checked, any failures except for a failure to Bind the user account, will be ignored and the login information will be passed to the next form action. This allows using both LDAP and the Form.io Login action on the same form.
LDAP Property: Group name within the LDAP directory
Value: Given Role from the LDAP Directory
Role: Form.io role the Property group and Value will map to.
Walkthrough
LDAP Integration must first be configured within your Project settings before the workflow can function.
Build an LDAP Login Form
Create a new form that will be used to Login to LDAP:
Click on New Form, and then add a User Name text field and a Password field named Password:

Click the Create Form button to create the new form.
Next, ensure that Anonymous users are able to submit this form.
Click on the Access settings and add the Anonymous role to the Create Own Submissions permission.

Add the LDAP Login Action
Navigate to the Actions section of the form.
Remove the Save Submission Action by clicking the red trash can icon.
Select LDAP Login (Premium) then click Add an action button.

Configure the LDAP Login Action
Within the LDAP Login Action, configure the following parameters:
Username field - Map to the Form's User Name component.
Password Field - Map to the Form's Password component.
LDAP Property - Leave blank
Value - Leave blank
Role - Select Authenticated
This will assign the Authenticated role to all LDAP users who authenticate through the form.

When using Passthrough authentication, any failures except for a Failure to Bind the User Account, will be ignored and the login information will be passed to the next form action. This allows using both LDAP and the Form.io Login action on the same form.
Assign Roles
To assign additional roles to the usesr upon Authentication, map any LDAP properties to user roles:
Fill in the property with the corresponding property that maps to the desired role.
Fill in the corresponding value.
Select the Role that will be assigned to any users who match the criteria. For example:
LDAP Property: group
Value: Admins
Role: Admin
Would assign the Admin Form.io role to any members of the LDAP Admins group.
Leaving LDAP Property and Value will to assign the role to all LDAP accounts who authenticate.
The user’s DN is also mapped to the list of properties. For example, if the DN is dn=myname,ou=admins,dc=example,dc=org you can do:
LDAP Property: ou
Value: admins
Role: Admin
Save the changes before proceeding.
Testing LDAP Login
To test the LDAP login, perform the following API request within Postman:

Here you will see that the Authenticated role has been assigned to the user object.
Last updated
Was this helpful?
