- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 opendj-ldap-sdk-2.6.0 jar 库来搜索 LDAP 条目。我正在按照指南进行操作。(https://backstage.forgerock.com/docs/opendj/2.6/dev-guide/#chap-using-the-sdk)
源代码:
import org.forgerock.opendj.ldap.Connection;
import org.forgerock.opendj.ldap.LDAPConnectionFactory;
import org.forgerock.opendj.ldap.SearchScope;
import org.forgerock.opendj.ldap.responses.SearchResultEntry;
import org.forgerock.opendj.ldap.responses.SearchResultReference;
import org.forgerock.opendj.ldif.ConnectionEntryReader;
import org.forgerock.opendj.ldif.LDIFEntryWriter;
public class Test {
public static void main(String[] args) {
final LDIFEntryWriter writer = new LDIFEntryWriter(System.out);
Connection connection = null;
try {
final LDAPConnectionFactory factory = new LDAPConnectionFactory("localhost",389);
connection = factory.getConnection();
connection.bind("cn = Directory Mangager", password );
// password is just an example of the password.
final ConnectionEntryReader reader = connection.search("dc=example,dc=com", SearchScope.WHOLE_SUBTREE,"(uid=bjensen)","*");
while (reader.hasNext()) {
if(reader.isEntry()) {
final SearchResultEntry entry = reader.readEntry();
writer.writeComment("Search result entry:" + entry.getName().toString());
writer.writeEntry(entry);
} else {
final SearchResultReference ref = reader.readReference();
writer.writeComment("Search result reference:" + ref.getURIs().toString());
}
}
writer.flush();
} catch (final Exception e) {
System.err.println(e.getMessage());
} finally {
if (connection !=null) {
connection.close();
}
}
}
connection.bind("cn = Directory Mangager", password );
我在密码下的这一行看到一条红线,因为参数必须是“char []”。
我在下面捕获了 Bind 方法。如果我的密码是1234,如何将其更改为char[]类型?
最佳答案
您错过了来自工厂的获取连接的调用。
connection = factory.getConnection();
connection.bind("cn = Directory Mangager", password );
关于java - (opendj-ldap-sdk-2.6.0) 绑定(bind)方法参数-密码字符[ ],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53880689/
我正在尝试在“不带 Hyper-V 的 Windows Server 2008 Standard”环境中安装 OpenDJ 2.6.0。 当我尝试导入 ldif 文件时,安装过程中出现错误,但安装确实
我正在使用 OpedDJ LDAP,有时在执行搜索请求时会收到 NegativeArraySizeException(null,-1)! 有没有办法在发生异常时查看完整的 stackTrace?(已经
我已经成功创建了一个层次结构,其中包含三个组织单位,即: ou=人 || ou=组 || ou=角色(这些是基本DN下的三个不同节点) 在人员下,我有用户条目(例如 edanny),每个条目都有 ob
我使用 OpenDJ 作为托管一些 EJB 3.1 bean 的 Glassfish 服务器的身份验证模块。我目前使用 OpenDJ LDAP SDK 以编程方式添加或修改用户,并且我需要将每个 LD
有人能告诉我为什么 curl 不使用 ldaps 和自签名证书吗? 我有一个 Opendj 目录服务器在 ldaps 端口 636 上监听,我正在尝试使用 curl 和 opendj 的自签名证书从远
嗨,请说明使用哪个 OpenDS OpenDJ OpenAM。谢谢。 最佳答案 OpenDJ 是一个构建 LDAP 和 REST 基础目录服务的开源项目。 OpenDJ 正在继续开源 OpenDS 的
我正在尝试连接(绑定(bind))到 Docker 中的 OpenDJ 服务器。 (我知道如何连接到常规(不是 Docker)OpenDJ 服务器) OpenDJ 似乎可以运行,但是当我尝试使用 ld
我必须从 java JNDI 在 LDAP 服务器中创建自定义对象类。对象类应具有 3 个带有值的字段:名称、OID、描述。迄今为止我已经成功地只定义了环境。 Properties propertie
我已通过 OpenDJ 控制面板向用户添加了一张图片,但我似乎无法检索该图片以便在网页上显示它。我找到了两个属性 thumbnailPicture 和 photo 并尝试通过以下方式访问它: Nami
我们正在寻求实现开源身份管理系统,并已将 ForgeRock 的堆栈确定为最佳实现技术。 然而,ForgeRock 支持及其按用户定价模型的高成本是一个潜在的障碍。我们目前的用户群约为 45K,但我们
我遇到了以下问题。有可用的 OpenDJ 服务器,使用 UnboundID LDAP SKD for Java 进行连接。我学会了如何搜索特定条目,但是获取给定条目的“entryUUID”属性值的方法
我对 OpenDj 上的“ismemberof”有一些疑问。 我想在 OpenDj 中有一个用户(比如“uid=jdoe,ou=people,dc=example,dc=com”),它可以做一个“is
我正在使用 opendj-ldap-sdk-2.6.0 jar 库来搜索 LDAP 条目。我正在按照指南进行操作。(https://backstage.forgerock.com/docs/opend
在 OpenAM-OpenDJ 的 Docker 化过程中面临一个关键问题 如果 OpenAM 容器崩溃或失败,我们被迫再次重新部署 OpenAM,它将无法连接到旧版 OpenDJ,我们需要再次重置
我是一名优秀的程序员,十分优秀!