Tomcat Must Login Twice with LDAP

2019-05-09 08:17发布

I changed our Tomcat 5.5.7 to use LDAP and now users have to login twice for it to work. The first time they try to login it will say "Invalid username or password". After they successfully login the second time users can logout and re-login on the first try. This will reset after an hour and then users have to login twice again. During this hour users will be able to login on the first try from any PC, but after the hour of inactivity someone will have to login twice.

I have seen a few other posts about this but not many provided a solution and the ones that did failed to solve my problem.

Here is my Realm configuration:

<Realm className="org.apache.catalina.realm.JNDIRealm"
            connectionURL="ldap://company.com:3268/"
            authentication="simple"
            referrals="follow"
            connectionName="CN=account,OU=Service Accounts,OU=company,DC=company,DC=com"
            connectionPassword="xxxx"
            connectionTimeout="30000"
            userSearch="(sAMAccountName={0})"
            userBase="DC=company,DC=com"
            userSubtree="true"
            roleSearch="(member={0})"
            roleName="cn"
            roleSubtree="true"
            roleBase="DC=company,DC=com"
    />

0条回答
登录 后发表回答