简体   繁体   中英

multiple active directory server authentication using java

i have three active directory servers In my app when user log-in the system i have to authenticate.在我的应用程序中,当用户登录系统时,我必须进行身份验证。 The user provide his username and password only not the domain name or ip address. How can i authenticate him, whether i have to loop through the all the ldap server and when i get the Context i have to break it.. or is any other possible solution is there for please suggest.请建议。 thanks in advance

If the user gives his FDN or UPN (User Principal Name) instead of just an user name it will be helpful. But still there is no guarantee that upn will match your realm name. If he gives FDN then atleast you can cache defaultNamingContext from all the three server and try to match it with the fdn provided by the user and authenticate him against the matching server.

But I guess he is providing the samAccountName in your case. In this case we dont have any clue to identify the server. You have to go through one by one and probably cache it which server he is authenticated against for next time performance improvment. Its also possible that the same username exist in multiple AD. You have to handle this case based on your AD environment.

as a additional note, if its web application try using spring's ldapTemplate. This might ease your task.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM