java - 在 Java 的 Active Directory 系统中通过 IP 对用户进行身份验证

标签 java linux active-directory ldap

我可以在 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/

相关文章:

linux zip 并通过 bash/shell 脚本排除目录

Linux dd 创建多个iso文件

java - tomcat 中的 <session-timeout> 过期非常快(1 天 > 7 天)

java - 在Java中, "decorate and sort"简洁的实现?

linux - 必须在 macbook 上运行导出命令才能使用 PhoneGap 创建 Android 项目

c# - Active Directory 在 C# 中找不到所有用户

c# - 如何在 Active Directory C# 中的指定 ou 下面列出 ous(组织单位)

c# - FindByIdentity 在 ASP.NET webapp 中因 PricipalOperationException 而失败

java - TextField.bindAutoCompletion 返回对象 ID

Java Swing-更改按下的按钮的图标