【发布时间】:2011-09-14 01:08:54
【问题描述】:
我有两个 Web 服务(MyService 和 MyProtectedService)。我希望两者都在同一个端口 HTTPS 下,但只有受保护的端口具有客户端身份验证 (clientAuth=true)。
所有的安全措施都工作正常,但问题是客户端身份验证对这两种服务都是开启的,而不仅仅是受保护的服务。我想要的是删除其中一个的客户端身份验证,或者仅将客户端身份验证应用于另一个。
有人有什么提示吗?谢谢
在 web.xml 中:
<security-constraint>
<web-resource-collection>
<web-resource-name>protected element</web-resource-name>
<description/>
<url-pattern>/MyProtectedService</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
更新: 我试图将服务分为两个约束:
<security-constraint>
<web-resource-collection>
<web-resource-name>OpenService</web-resource-name>
<description/>
<url-pattern>/OpenService</url-pattern>
</web-resource-collection>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>protected</web-resource-name>
<description/>
<url-pattern>/MyProtectedService</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
<login-config>
<auth-metod>CLIENT-CERT</auth-metod>
</login-config>
</security-constraint>
并且在 server.xml 中有 ClientAuth=false。
但是我可以在没有任何客户端身份验证的情况下访问它: https://MACHINE/MyProtectedService/MyProtectedService?wsdl
【问题讨论】:
标签: security authentication tomcat client web.xml