简体   繁体   English

LDAP验证Java Play

[英]Ldap authentication java play

I am developing aN application using play framework. 我正在使用play框架开发aN应用程序。 I need to use LDAP for user authentication. 我需要使用LDAP进行用户身份验证。 My client is given me a master user who has privileged to do the ldap query. 我的客户有一个有权执行ldap查询的主用户。

  • I am done with first step (do the ldap query) and also getting list of results. 我已经完成第一步(执行ldap查询),并且还获得了结果列表。
  • Also filtering for a specific user is also done using below 还可以使用以下方法针对特定用户进行过滤

     NamingEnumeration results = context.search("ou=people,ou=internal,o=Compay,c=Country", "uid=TestUser", constraints); 

My question is how can I authenticate the second user via the master user? 我的问题是如何通过主用户验证第二个用户? The TestUser . TestUser

Actually it depends which middle ware are you using to connect with LDAP. 实际上,这取决于您使用哪个中间件与LDAP连接。 Like I was using APACHEDS API for communicating with LDAP. 就像我使用APACHEDS API与LDAP通信一样。 It provides me a method "BIND" which takes username and password. 它为我提供了一种使用用户名和密码的“ BIND”方法。 I performed authentication using bind if bind is success user authenticated else not. 如果绑定成功,则我使用绑定执行身份验证,否则未通过身份验证。

There are some other implementation as well which provide their own mechanism. 还有一些其他实现也提供了自己的机制。 You need to check the middle ware you are using. 您需要检查所使用的中间件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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