我已经在 Jboss 实例中配置了 ldap,但是它没有连接到 ldap 服务器并抛出以下错误。
02:50:08,512 DEBUG [org.wildfly.security] (management task-1) Obtaining lock for identity [user1]...
02:50:08,513 DEBUG [org.wildfly.security] (management task-1) Obtained lock for identity [user1].
02:50:08,517 DEBUG [org.wildfly.security] (management task-1) Creating [class javax.naming.directory.InitialDirContext] with environment:
02:50:08,517 DEBUG [org.wildfly.security] (management task-1) Property [java.naming.security.credentials] with value [******]
02:50:08,517 DEBUG [org.wildfly.security] (management task-1) Property [java.naming.security.authentication] with value [simple]
02:50:08,518 DEBUG [org.wildfly.security] (management task-1) Property [java.naming.provider.url] with value [ldap://ldap_server:3268]
02:50:08,518 DEBUG [org.wildfly.security] (management task-1) Property [com.sun.jndi.ldap.read.timeout] with value [60000]
02:50:08,518 DEBUG [org.wildfly.security] (management task-1) Property [com.sun.jndi.ldap.connect.pool] with value [false]
02:50:08,518 DEBUG [org.wildfly.security] (management task-1) Property [com.sun.jndi.ldap.connect.timeout] with value [5000]
02:50:08,518 DEBUG [org.wildfly.security] (management task-1) Property [java.naming.security.principal] with value [CN=svc_account,OU=IT,DC=local,DC=xxx,DC=xxx]
02:50:08,518 DEBUG [org.wildfly.security] (management task-1) Property [java.naming.referral] with value [ignore]
02:50:08,519 DEBUG [org.wildfly.security] (management task-1) Property [java.naming.factory.initial] with value [com.sun.jndi.ldap.LdapCtxFactory]
02:50:08,536 DEBUG [org.wildfly.security] (management task-1) Could not create [class javax.naming.ldap.InitialLdapContext]. Failed to connect to LDAP server.: javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C090449, comment: AcceptSecurityContext error, data 52e, v3839]
默认情况下,Active Directory 不再允许以纯文本形式发送未加密凭据的不安全绑定。
您应该更新代码以建立安全 (TLS) 连接。然后连接到安全端口 (636/3269)。
https://support.microsoft.com/en-us/topic/2020-2023-and-2024-ldap-channel-binding-and-ldap-signing-requirements-for-windows-kb4520412-ef185fb8-00f7-167d-744c-f299a66fc00a
我为主体使用了不正确的 OU,将详细信息修改为正确的值,从而解决了此错误。