I'm using weblogic and sun iplanet ldap, I have questions like:
1. what's the benefit of using LDAP authentication instead of custom database authentication?
2. I saw in some J2EE projects, both LDAP and database authentication were used. what's the benefit of this? and if so, user info need to be stored in both LDAP and database when registered?
3. if JNDI API was used in servlet for LDAP authentication, do I need to set authenticated user in session myself or the servlet container would associate this session with authenticated user and transfer to EJB container when access EJB?
LDAP is a protocol to access a directory server. Directory servers are typically like a telephone directory that is highly optimized for very fast searches. So in an application with a large load, this improvement in performance helps a lot. Also, the directory server can be used to store authentication data centrally to be shared among multiple applications.
Certain appservers like SUNONE for instance provides APIs like EJBProgrammatic login class which takes app server user ID and password as one of the params. So in these cases you will have to authenticate yourself to access the EJB. Remember the EJBs always reside in their own container and not on the servlet container.