在用户使用 JNDIRealm 身份验证登录 Tomcat 期间,我在 Catalina 日志中收到以下错误:
26-Jun-2018 12:08:29.547 SEVERE [http-nio-8080-exec-7] org.apache.catalina.realm.JNDIRealm.authenticate Exception performing authentication javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C090400, comment: AcceptSecurityContext error, data 52e, v1db1 ] at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3154) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3100)
我发现这意味着“错误的用户/密码”,但在 LDAP 日志中没有与此登录相关的记录。 我的 server.xml:
<Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
connectionURL="ldap://me.com:389"
alternateURL="ldap://me.com:389"
connectionName="CN=user-ldap,OU=Services Accounts,DC=me,DC=com"
connectionPassword="removed"
userRoleName="member"
userBase="OU=Groups,DC=me,DC=com"
userPattern="cn={0},cn=Users,DC=me,DC=com"
roleBase="cn=Users,DC=me,DC=com"
roleName="cn"
roleSearch="(member={0})"
roleSubtree="false"
userSubtree="true"
/>
最佳答案
LDAP: error code 49非常清楚,数据 52e 暗示当用户名有效但密码/凭据无效时返回(这是 Microsoft Active Directory)
所以这表示您有正确的用户,但用户是错误的。
关于authentication - Tomcat JNDIRealm 验证异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51131776/