This configuration uses nsswitch and compat mode, which is supposedly obsolete, but much more convenient than alternatives.
emerge -va sys-auth/nss_ldap sys-auth/pam_ldap sys-apps/unscd
Note: unscd (Micro Name Service Caching Daemon) is not necessary, but it’s recommended.