Issue
- We have an LDAP server connected to Liferay and we want to deactivate Liferay users automatically when they are deactivated on LDAP.
Environment
- Liferay DXP 7.3
- Liferay DXP 7.4
Resolution
- We can use the Status attribute to achieve it:
1. Access Control Panel > Instance Settings > Security > LDAP > Servers.
2. Edit the LDAP Server configuration.
3. Map the corresponding attribute from your LDAP into the Status field.
4. Press save. - The appropiate values are:
0
to active users and5
to deactive users, so your LDAP attribute has to provide these values.
When a LDAP user is imported into Liferay, the user is automatically activated if the Status field recives a0
value and deacivated if the Status field recives a5
value.
Additional Information
- What can I do if my LDAP attribute has values other than
0
or5
?
Is there a way to transform them into the right ones? - One solution could be to develop an AttributesTransformer, please check this article to know how: