Issue
- For any virtual instances apart from a default instance, if the "Required" option in LDAP is enabled, only LDAP users can log in to the portal. When the LDAP server is down/unreachable, none of the users able to log in. In that case, how to login to the portal to make the changes in LDAP configurations.
Environment
- Liferay DXP 7.2
- Liferay DXP 7.1
Resolution
Placing the config file(com.liferay.portal.security.ldap.authenticator.configuration.LDAPAuthConfiguration.config) inside the configs folder would help to enable and disable the "Required" option and even disabling the LDAP server as well based on the values. By doing so, any user can log in to the portal.
How to get config file?
Step1: Enable LDAP from System Settings and export the config file.
Control Panel -> Configuration -> System Settings -> LDAP -> Click on the lexicon three-dot button and click on export. It will provide the config file.
(disable LDAP from system settings after downloaded the config file)
Step2: Need to find the companyId.
Control Panel -> Configuration -> Virtual Instances -> Note the Instance Id.
Note: Instance Id and companyId are same.
Update the downloaded .config file by placing the respective Instance Id in companyId field, set "false" for "required" option to disable the Required option, and set "false" for "enabled" option to disable the LDAP server. Once it is done, place the config file inside this location {LIFERAY_HOME}/osgi/configs/ to make changes in LDAP without logging in into the portal.
For your ease reference: Config file(com.liferay.portal.security.ldap.authenticator.configuration.LDAPAuthConfiguration-1b6b062e-3ed6-429e-90bc-3bd919d20fb5.config) and its contents.
companyId = L"35449"
enabled = B"false"
method="bind"
passwordEncryptionAlgorithm="NONE"
passwordPolicyEnabled = B"false"
required = B"false"
Additional Information
- Please be informed that this is a workaround to overcome the situation and this may differ case by case.
- Liferay strongly recommends to provide the concrete connection between the LDAP server and Liferay for seamless login.