【发布时间】:2023-03-27 20:36:01
【问题描述】:
我正在设置一个 Tomcat 8.5 服务器以对 Tomcat 的管理器部分使用 LDAP 身份验证。到目前为止,我已经使用正确的领域设置更改了 server.xml。
<Realm className="org.apache.catalina.realm.JNDIRealm"
debug="99"
connectionURL="ldap://ldap.server.com:389"
authentication="simple"
referrals="follow"
connectionName="CN=user,OU=Service,OU=Users,DC=server,DC=group,DC=mainserver,DC=com"
connectionPassword="password of the user"
userSearch="(sAMAccountName={0})"
userBase="DC=group,DC=mainserver,DC=com"
userSubtree="true"
roleSearch="(member={0})"
roleName="name of the ldap role"
roleSubtree="true"
roleBase="OU=Groups,DC=group,DC=mainserver,DC=com"/>
现在我想使用 LDAP 组来授予用户访问 tomcat 管理器/状态页面的权限。我怎样才能做到这一点?我试图将管理器的 web.xml 更改为
<security-role>
<description>
The role that is required to access the HTML Manager pages
</description>
<role-name>LDAP group</role-name>
</security-role>
<security-role>
<description>
The role that is required to access the text Manager pages
</description>
<role-name>LDAP group</role-name>
</security-role>
<security-role>
<description>
The role that is required to access the HTML JMX Proxy
</description>
<role-name>LDAP group</role-name>
</security-role>
<security-role>
<description>
The role that is required to access to the Manager Status pages
</description>
<role-name>LDAP group</role-name>
</security-role>
但是没有用。现在可以使用用户登录,但是当我浏览管理器页面时出现“403 Access Denied”错误。同样在Tomcat的日志文件中也没有任何错误。
【问题讨论】:
标签: tomcat authentication ldap