Prerequisites:
- An LDAP server. I use both OpenLDAP and SunONE Directory Server
- Sun Java System Application Server 9.x (Project Glassfish). I am using Glassfish V2 Build 37
1. Log into the glassfish administration console.
2. Navigate to the Resources --> JNDI --> External Resources tree.
3. Create a new JNDI External Resource (see image below)
- JNDI Name: pick a unique name for the resource. I prefix mine with ldap e.g. ldap/myldap
- Resource Type: javax.naming.ldap.LdapContext
- Factory Class: com.sun.jndi.ldap.LdapCtxFactory
- JNDI Lookup: this would be your BaseDN e.g. dc=bluelotusholdings,dc=com
4. Check to make sure that the resource was created correctly and that it appears in the server JNDI Browser. If it does, you have configured it correctly. To find the JNDI Browser go to Application Server --> JNDI Browsing.
5. You should see something that looks like the image below. Please note the organizationalUnit (ou) ou=people and ou=groups are displayed as nodes in the BaseDN.
Success!