- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 UnboundID LDAP Java SDK 将 Groovy/Grails 应用程序连接到 Active Directory。以下是我正在使用的连接选项:
LDAPConnectionOptions options = new LDAPConnectionOptions()
options.connectTimeoutMillis = 60000 // 1 minute
options.followReferrals = true
options.referralHopLimit = 10
options.responseTimeoutMillis = 60000 // 1 minute
options.useSynchronousMode = true
但是,我仍然不断收到结果代码为 10 的 LDAPSearchException,这意味着服务器发送了引用。将 RefererHopLimit 更改为更高的数字并没有帮助,因此显然该库没有遵循引用。
到目前为止,我似乎只在使用 LDAPConnection.getEntry 方法加载 DN 指定的特定条目时遇到此问题。我在搜索时还没有收到。所以我想知道 getEntry 方法是否不应该遵循引用,如果是这种情况,手动遵循引用或更改其行为的最佳方法是什么?
最佳答案
getEntry 方法在后台使用搜索,因此如果搜索有效,那么 getEntry 也应该有效。我刚刚进行了快速测试,它对我有用。使用最新的 LDAP SDK 版本 (2.3.6) 和以下代码,我在遵循引用后得到了预期的条目。如果我注释掉“opts.setFollowReferrals(true)”行,则会收到引用异常:
import com.unboundid.ldap.listener.*;
import com.unboundid.ldap.sdk.*;
public class ReferralTest
{
public static void main(final String... args)
throws Exception
{
final InMemoryDirectoryServerConfig cfg =
new InMemoryDirectoryServerConfig("dc=example,dc=com");
final InMemoryDirectoryServer ds1 = new InMemoryDirectoryServer(cfg);
final InMemoryDirectoryServer ds2 = new InMemoryDirectoryServer(cfg);
ds1.startListening();
ds2.startListening();
final LDAPConnectionOptions opts = new LDAPConnectionOptions();
opts.setFollowReferrals(true);
final LDAPConnection conn1 = ds1.getConnection(opts);
final LDAPConnection conn2 = ds2.getConnection(opts);
conn1.add(
"dn: dc=example,dc=com",
"objectClass: top",
"objectClass: domain",
"dc: example");
conn1.add(
"dn: ou=Referral Entry,dc=example,dc=com",
"objectClass: top",
"objectClass: organizationalUnit",
"ou: Referral Entry",
"description: This is a referral entry");
conn2.add(
"dn: dc=example,dc=com",
"objectClass: top",
"objectClass: domain",
"dc: example");
conn2.add(
"dn: ou=Referral Entry,dc=example,dc=com",
"objectClass: top",
"objectClass: referral",
"objectClass: extensibleObject",
"ou: Referral Entry",
"ref: ldap://127.0.0.1:" + ds1.getListenPort() +
"/ou=Referral Entry,dc=example,dc=com");
final Entry e = conn2.getEntry("ou=Referral Entry,dc=example,dc=com");
System.out.println(e.toLDIFString());
conn1.close();
conn2.close();
ds1.shutDown(true);
ds2.shutDown(true);
}
}
关于java - UnboundID LDAP SDK 不遵循推荐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24127334/
使用 UnboundID LDAP sdk,如何获取特定用户所属的所有 LDAP 组? (我真的很感激一些示例代码)。 最佳答案 我也有同样的问题。但是,迈克尔的解决方案对我不起作用,因为它不能递归地
关于我的另一个问题:UnboundID LDAP DIGEST-MD5 binding cause NPE 我使用 ApacheDS 作为服务器,使用 UnboundID 作为 API。 我按照建议的
我正在从我的 Activity 目录中获取组成员,其中有很多记录。我想在检索时添加分页支持。 unboundid 有什么办法支持它吗? 或者我手动添加分页。 最佳答案 我假设您指的是 Microsof
我需要根据 Active Directory 评估用户的密码到期时间。 我正在使用 Android 和 Unboundid sdk。我可以使用此代码成功连接到服务器 final SocketFacto
如何在以下位置调用 SSL 连接: com.unboundid.ldap.sdk.migrate.ldapjdk.LDAPConnection; ? 以下内容: SSLUtil sslUtil = n
我必须从我的 ldap 学校获得 200 个用户,但问题是我无法获得超过 200 个用户,否则我会遇到异常: String filter = "uid=G26274"; String[] arra
我正在开发一个网络应用程序,让用户可以在 Active Directory 中重置自己的密码。我一直通过以管理员身份进行绑定(bind)来做到这一点并且它工作正常,但是没有强制执行目录策略(重用历史记
如果您有一个属性,其值由逗号分隔的值列表组成,那么这将是检索该值的某些部分的最佳方法? 示例: myAttribute: value1, value2, value3, value4 到目前为止,我已
我正在使用 UnboundID LDAP Java SDK 将 Groovy/Grails 应用程序连接到 Active Directory。以下是我正在使用的连接选项: LDAPConnecti
我想使用 SSL 监听器启动内存中的 UnboundID 服务器。到目前为止,我只能创建一个非 SSL 的,如在许多示例中所见。不幸的是,我似乎无法找到说明如何添加 SSL 监听器的示例。所有 SSL
我正在尝试使用 UnboundID LDAP SDK 将组添加到我的 Active Directory 服务,并不断收到错误 503:将无法执行。 我已经验证我正在使用 SSL 连接,并且我正在与属于
我选择了适用于 Java 的 UnboundID LDAP SDK。我在云中的某个位置部署了 Bastion 服务器和 Microsoft Active Directory 在同一网络中。如果我在 B
我正在开发一个 Android 应用程序,其中使用 unboundedID.jar 实现了 SSL TLS但不知道 SASL 你能给我一些想法吗?一些示例代码。如何实现 SASL未绑定(bind)id
我正在尝试使用下面的代码更改 LDAP 中的用户密码,我不是 LDAP 的管理员,因此我与具有 ou=systemusers 的用户建立连接,它可以创建用户,并且将用户添加到组中。我知道用于更改的旧密
我们正在构建一个新的库,它需要对我们的主要身份管理 LDAP 系统进行读/写。 我们正在考虑使用 Spring LDAP ( http://projects.spring.io/spring-ldap
我需要一些关于 UnboundID 的帮助。我听说这是一个不错的选择,但我不太习惯。 所以我需要制作一个 LDAP 监听器。在这个监听器上,我应该能够捕获绑定(bind)请求(例如来自 ldap 浏览
我使用 OpenLDAP 作为 LDAP 服务器,使用 UnboundID 通过 Java 代码与其交互。我需要处理实体 A 的某个实例 X 的删除,实体 B 的其他几个实例 Y1、.. Yn 在逻辑
如何使用 UnboundID LDAP SDK 连接到本地主机?我认为这很简单,但也许不是。我使用以下代码连接得很好,但我希望可以选择仅使用 locahost 连接而不必进行身份验证。 通过连接,我执
我编写了一个程序,用于读取 Web 服务、检索用户数据,然后将该数据推送到 ActiveDirectory,从而更新用户的头衔、地址、电话号码等。 问题是,当我使用 Unboundid Connect
我想在 android 中使用 LDAP(轻量级目录访问协议(protocol))。但我不知道 LDAP。我看到了以下链接: Neil's LDAP SDK post 他这样说 Android 开发人
我是一名优秀的程序员,十分优秀!