我可以在 Java 语言的 Active Directory 系统中通过用户的 IP 对用户进行身份验证吗?我通过 linux 机器连接到网络。我不知道我必须从哪里开始。
提前致谢
最佳答案
使用 UnboundID LDAP SDK SimpleBindRequest
或 SASL 绑定(bind)请求类之一来验证 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 ...;
}
另见
关于java - 在 Java 的 Active Directory 系统中通过 IP 对用户进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12621055/