我有两个Web服务(为MyService和MyProtectedService)。我希望两者都在相同的端口HTTPS下,但只有受保护的端口具有客户端身份验证(clientAuth = true)。Tomcat的安全访问
所有的安全工作正常,但问题是,客户端验证为ON两种服务,不仅为保护一个。我想要的是为其中一个移除客户端身份验证,或者仅将客户端身份验证应用于另一个身份验证。
没有人有什么暗示?由于
在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>
而且具有ClientAuth = server.xml中假。
但后来我可以访问此无需任何客户端身份验证: https://MACHINE/MyProtectedService/MyProtectedService?wsdl
谢谢您的回答。我尝试过这一点,我认为还有其他事情涉及到,因为我仍然被要求提供证书。如果不是https,我使用http:443,那么我会得到奇怪的字符。有任何想法吗? – 2011-06-15 09:32:01
@Codo,它似乎像Tomcat总是要求客户端身份验证(在web.xml之前检查server.xml,这是有道理的),所以我不认为你提到的可以工作...: - ? – 2011-06-15 12:29:38
任何有用的解决方案? – 2011-06-20 14:48:26