【发布时间】:2013-11-12 19:21:00
【问题描述】:
我一直在用头撞墙。我最近将 Tomcat 从 6.0.18 升级到 6.0.37,以修复安全团队的一些漏洞。除了 CAC 登录功能外,一切正常。这些配置在 6.0.18 中工作正常,但不适用于 6.0.37(给出 HTTP500 错误) 当用户使用 CAC 登录时,站点提示要求提供 CAC 证书,用户选择证书后,它会登录用户。
基本上,站点从 CAC 获取证书并使用 LDAP 进行身份验证以从 LDAP 检索用户名。该应用程序使用用户名来验证用户并登录使用。
它需要访问 /process.jsp 才能使用户名获得身份验证。但是在 web.xml 中它被设置为(受保护的页面)
请帮我指出正确的方向。我真的很感激。
我只是不明白为什么它在 Tomcat 6.0.37 中不起作用。是否需要为 Tomcat 6.0.37 设置任何新配置
下面是 server.xml 文件中 Connector 和 JNDIRealm 的配置:
<Connector port="443"
maxHTTPHeaderSize="8192"
allowUnsafeLegacyRenegotiation="true"
protocol="org.apache.coyote.http11.Http11Protocol"
SSLEnabled="true"
enableLookups="false"
disableUploadTimeout="true"
acceptCount="200"
maxThreads="150"
scheme="https"
secure="true"
keystoreFile="C:\Tomcat 6.0\cert\xxxx.keystore"
keystorePass="changeit"
truststoreFile="D:\Sun\SDK\jdk\jre\lib\security\cacerts"
truststorePass="changeit"
clientAuth="false"
sslProtocol="TLS"
ciphers="xxxxxxxxx"
address="0.0.0.0"/>
<Realm className="org.apache.catalina.realm.JNDIRealm"
connectionURL="ldap://xxx.xx.xx.xxx/"
alternateURL="ldap://xxx.xx.xx.xxx/"
connectionName="CN=xxxxxx,OU=xxxx Accounts,OU=xxxxx,DC=xxxx,DC=xxxx,DC=local" connectionPassword="MyPassword"
authentication="simple"
referrals="follow"
userSubtree="true"
userBase="OU=xxxxx,DC=xxxx,DC=dhhq,DC=local"
userRoleName="xxx"
userSearch="(altSecurityIdentities={0})" roleBase="CN=xxxxxxx,OU=xxxxxx,OU=Accounts,DC=xxxx,DC=xxxx,DC=local" roleSubtree="true"
roleName="cn"
roleSearch="(member={0})" />
web.xml 安全配置:
<security-constraint>
<web-resource-collection>
<web-resource-name>Myapp</web-resource-name>
<url-pattern>/process.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>User</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>CLIENT-CERT</auth-method>
<realm-name>TOMCATLDAP</realm-name>
</login-config>
<security-role>
<role-name>User</role-name>
</security-role>
【问题讨论】:
-
您将不得不记录 LDAP 中发生的事情。
-
我几乎没有接触过 LDAP;你能告诉我来自LDAP(或AD)的日志类型吗?谢谢!
-
当然不能。您甚至没有告诉我们您使用的是哪个 LDAP 服务器。
标签: tomcat ldap jndi client-certificates