【发布时间】:2014-07-08 21:10:21
【问题描述】:
我有一个 JAVA 应用程序,它使用 UnboundID LDAP SDK 连接到 LDAP 本地服务器并对其进行身份验证。
该服务器是带有 Active Directory 的 Windows Server 2008 R2,它被配置为不允许匿名身份验证。
但是,如果我尝试使用我的应用程序执行匿名绑定,则 BindResult 会成功。
我正在使用 JAVADOC says 之类的 SimpleBindRequest() 方法进行连接。这是我的代码:
public boolean autenticarAnonimamente() throws AutenticacaoExcecao
{
GerenciadorConexaoLdap gerenciadorLdap = new GerenciadorConexaoLdap();
LDAPConnection connection;
try {
connection = gerenciadorLdap.conectarServidorLdap(ldap);
SimpleBindRequest request = new SimpleBindRequest();
BindResult result = connection.bind(request);
boolean retorno = result.getResultCode().equals(ResultCode.SUCCESS);
connection.close();
return retorno;
} catch (LDAPException | GeneralSecurityException ex) {
throw new AutenticacaoExcecao(ex);
}
}
我尝试使用 Google Apps Directory Sync 测试我的服务器,但它拒绝任何匿名绑定。如果我将服务器配置为允许匿名连接,Google 应用程序结果正常。
有谁知道可以是什么?
【问题讨论】:
标签: java active-directory ldap bind unboundid-ldap-sdk