2017-04-25 125 views
0

我已經通過了其他stackoverflow的問題,但似乎沒有解決我的問題,即配置tomcat和ldap進行管理器訪問。 這裏是我所做的使用ldap身份驗證的tomcat管理器

  1. 配置JNDIRealm與ldap配置。
  2. 部署在tomcat上的管理器應用程序。

我能夠驗證用戶身份驗證成功,但日誌抱怨沒有任何關聯的角色。

2017-04-25 14:17:54,644 [http-8080-1] DEBUG org.apache.catalina.realm.RealmBase- Checking constraint 'SecurityConstraint[HTMLManger and Manager command]' against GET /html --> true 
2017-04-25 14:17:54,644 [http-8080-1] DEBUG org.apache.catalina.realm.RealmBase- Checking constraint 'SecurityConstraint[HTMLManger and Manager command]' against GET /html --> true 
2017-04-25 14:17:54,644 [http-8080-1] DEBUG org.apache.catalina.authenticator.AuthenticatorBase- Calling hasUserDataPermission() 
2017-04-25 14:17:54,644 [http-8080-1] DEBUG org.apache.catalina.realm.RealmBase- User data constraint has no restrictions 
2017-04-25 14:17:54,644 [http-8080-1] DEBUG org.apache.catalina.authenticator.AuthenticatorBase- Calling authenticate() 
2017-04-25 14:17:54,648 [http-8080-1] DEBUG org.apache.catalina.realm.CombinedRealm- Attempting to authenticate user "manager" with realm "org.apache.catalina.realm.JNDIRealm/1.0" 
2017-04-25 14:17:54,667 [http-8080-1] DEBUG org.apache.catalina.realm.CombinedRealm- Authenticated user "manager" with realm "org.apache.catalina.realm.JNDIRealm/1.0" 
2017-04-25 14:17:54,667 [http-8080-1] DEBUG org.apache.catalina.authenticator.AuthenticatorBase- Authenticated 'manager' with type 'BASIC' 
2017-04-25 14:17:54,667 [http-8080-1] DEBUG org.apache.catalina.authenticator.AuthenticatorBase- Calling accessControl() 
2017-04-25 14:17:54,667 [http-8080-1] DEBUG org.apache.catalina.realm.RealmBase- Checking roles GenericPrincipal[manager()] 
2017-04-25 14:17:54,667 [http-8080-1] DEBUG org.apache.catalina.realm.RealmBase- Different realm [email protected] [email protected] 
2017-04-25 14:17:54,667 [http-8080-1] DEBUG org.apache.catalina.realm.RealmBase- Username manager does NOT have role manager 
2017-04-25 14:17:54,668 [http-8080-1] DEBUG org.apache.catalina.realm.RealmBase- No role found: manager 
2017-04-25 14:17:54,668 [http-8080-1] DEBUG org.apache.catalina.authenticator.AuthenticatorBase- Failed accessControl() test 

注:我已經驗證了經理的角色在經理/ WEB-INF/web.xml中還存在我稱之爲tomcatRole =經理LDAP屬性。我在server.xml中爲JNDIRealm配置設置了userRoleName =「tomcatRole」。

我缺少什麼配置部分?

版本:tomcat6中
LDAP:OUD

感謝。

回答

0

我發現了這個問題。在ldap服務器上缺少ACI,因此tomcat進程無法在ldap上找到角色。增加了解決問題的新的aci。