This section uses the sample mentioned in JDK 1.4 JAAS Authentication tutorial. The enhancement is the LDAP authentication integrated with JAAS. Regarding the basics on JAAS, I have attached the links in the resources section.
I have modified the SampleLoginModule java (login method) to authenticate with LDAPAuthenticator class which picks up the ldap server properties and authenticates with LDAP user info.
The ldap server properties are specified in the ldap.properties. The properties file location is passed as the java parameter with jaas.config.
java -Djava.security.auth.login.config=D:\project\jaas-ldap\sample_jaas.config -Dldap.properties.config=ldap.properties SampleAcn