【发布时间】:2013-11-27 14:53:51
【问题描述】:
我对 SOAP Web 服务比较陌生,这似乎是一个基本的东西,但是我仍然找不到解决它的方法。我有一个使用带有 XWS 安全性的 Spring WS 编写的 SOAP 服务器。这些是相关的bean:
<bean id="wsSecurityInterceptor" class="org.springframework.ws.soap.security.xwss.XwsSecurityInterceptor">
<property name="policyConfiguration"
value="classpath:security-policy.xml"/>
<property name="callbackHandlers">
<list>
<ref bean="passwordValidationHandler"/>
</list>
</property>
</bean>
<bean id="passwordValidationHandler" class="org.springframework.ws.soap.security.xwss.callback.SimplePasswordValidationCallbackHandler">
<property name="users">
<props>
<prop key="user">*****</prop>
</props>
</property>
</bean>
以下是security-policy.xml:
<xwss:SecurityConfiguration xmlns:xwss="http://java.sun.com/xml/ns/xwss/config">
<xwss:RequireUsernameToken passwordDigestRequired="true" nonceRequired="true"/>
<xwss:UsernameToken digestPassword="true" useNonce="true"/>
</xwss:SecurityConfiguration>
问题是我想使用 nonce(一种一次性令牌,防止再次发送截获的请求)来进行摘要式身份验证。据我所知(这里描述为http://www.whitemesa.com/soapauth.html#S4),服务器应该创建一个挑战(我认为是随机数和时间戳),然后客户端应该用它的密码和时间戳对其进行加密并将其发送回服务器确认。这应该适用于每个请求。即使用户发送一个空请求,服务器也应该提供一个质询。但就我而言,它不起作用。我错过了什么吗?
【问题讨论】:
标签: web-services soap soap-client spring-ws