我可以使用Java语言在Active Directory系统中通过IP验证我的用户吗?我通过linux机器连接到网络。我不知道我必须从哪里开始。
提前致谢
答案 0 :(得分:1)
使用UnboundID LDAP SDK SimpleBindRequest
或其中一个SASL绑定请求类来验证LDAP客户端连接。客户端将需要可分辨名称和简单BIND请求的凭据。 LDAP客户端应确定如何从IP地址创建可分辨名称。
例如:
final String hostname = "the hostname";
final int port = PORT; // sometimes 389
try
{
final LDAPConnection connection = new LDAPConnection(hostname,port);
try
{
final SimpleBindRequest request = new SimpleBindRequest(bindDN,bindPassword);
final BindResult result = connection.bind(request);
}
finally
{
connection.close();
}
}
catch(final LDAPException ex)
{
handle the exception ...;
}
答案 1 :(得分:1)