<p>What is the best way to design a user login mechanism using Java? What are the best practices to be followed to architect a secure and robust login mechanism? </p>

<p>What is the difference between JAAS, JNDI and GSSAPI? How do you decide which one to choose?</p>

It depends on your user referential.
You need to be able to connect your login java module with that base. it is is LDAP, you might consider framework like
OpenLDAP
.
Plus you have to consider what is include in your "login" perimeter: It is is an "habilitation" login process, you need to have more that just the user name, but also other parameters helping your java module to grant him access (its group, which might be in LDAP, but also the kind of action he wants to make, in order to check if he has the required accreditation level)