Tomcat JNDIRealm认证异常

时间:2018-07-02 08:19:58

标签: authentication tomcat ldap jndi

在使用JNDIRealm身份验证登录到Tomcat的用户期间,我在Catalina日志中收到以下错误:

  

2018年6月26日12:08:29.547严重[http-nio-8080-exec-7] org.apache.catalina.realm.JNDIRealm.authenticate执行身份验证的异常    javax.naming.AuthenticationException:[LDAP:错误代码49-80090308:LdapErr:DSID-0C090400,注释:AcceptSecurityContext错误,数据52e,v1db1]       在com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3154)       在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" 
/>

1 个答案:

答案 0 :(得分:0)

LDAP: error code 49非常清楚,数据52e表示当用户名有效但密码/凭据无效时返回(这是Microsoft Active Directory)

因此,这表明您拥有正确的用户,但是错了。