1. Set up LDAP server and add a user in it with
(This is just a sample, we don't set mail)
2. in portal-ext.properties, set
in /liferay-portal/portal-impl/src/content/Language.propertiesLanguage.properties, set
then run "ant build-lang" and "ant deploy" in /portal-impl. We want to set last name not required.
3. Start portal. Go to control panel -> Configuration -> Portal Settings -> Authentication -> LDAP, check "Enable", "Enable Import".
4. Go to control panel -> Configuration -> Portal Settings -> Authentication -> General -> "How do users authenticate?", select "By Screen Name"
Please notice: as customer doesn't map for email address, so portal shouldn't use email address as users authenticate method. Because when do importing users, portal would do search for user with authenticate method as a searching condition. So please go to Control panel -> Configuration -> Portal Settings -> Authentication, "How do users authenticate?", change "By Email Address" to "By Screen Name". This is essential. If not doing this, portal would throw NPE because of no user is found.
5. Add LDAP server, click Reset Values. Then click "Test LDAP Users". The user should be fetched.
6. Remove Email Address or Last Name mapping.
7. Then click "Test LDAP Users".
Actual: It shows"Please map each of the user properties Screen Name, Password, Email Address, First Name, and Last Name to an LDAP attribute."
Expect: The user should be fetched since email address and last name are not required.