【问题标题】:Spring WS digest authentication with nonce, create challenge使用 nonce 进行 Spring WS 摘要身份验证,创建挑战
【发布时间】: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


    【解决方案1】:

    事实证明,生成随机数的不一定是服务器。我在客户端生成它,根据rules 连接并散列它,然后发送到服务器。坦率地说,我只能通过调试 Spring WS 源代码并查找身份验证问题的确切位置来找到错误的根源。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多