I am working on one java application. I am using Apache tomcat for this. I have one login page and i want user to login with OS NTNET username and password. I have details of our Active Directory. Now i want to authenticate the username password provided in my jsp page with the details we have in the active directory. I am not sure how LDAP will work here. Should we use JNDI Realm or something else is needed. What i tried till now is i updated the server.xml and web.xml files of tomcat with AD details. and updated my validate.jsp with below code:
`import java.security.Principal;
……
Principal principal = request.getUserPrincipal();
String userName = principal.getName();
.…`
But it didn't help. If some one can help here it would be great.