1

在 SpringWS 的春季安全中,我正在使用

<bean id="wsSecurityInterceptor" class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
    <property name="validationActions" value="UsernameToken" />
    <property name="validationCallbackHandler" ref="springSecurityHandler" />
</bean>

<bean id="springSecurityHandler"
  class="org.springframework.ws.soap.security.xwss.callback.SpringPlainTextPasswordValidationCallbackHandler">
    <property name="authenticationManager" ref="authenticationManager"/>
</bean>

以上配置。但错误是 javax.security.auth.callback.UnsupportedCallbackException

当我在 SpringPlainTextPasswordValidationCallbackHandler 中调试时发现它没有进入循环

protected void handleInternal(Callback callback) throws IOException, UnsupportedCallbackException {
    if (callback instanceof PasswordValidationCallback) {
        PasswordValidationCallback validationCallback = (PasswordValidationCallback) callback;
        if (validationCallback.getRequest() instanceof PasswordValidationCallback.PlainTextPasswordRequest) {
            validationCallback.setValidator(new SpringSecurityPlainTextPasswordValidator());
            return;
        }
    }

可能是什么问题,请帮助

谢谢

4

1 回答 1

0

使用以下回调:

<bean id="springPlainTextPasswordValidationCallbackHandler" class="org.springframework.ws.soap.security.wss4j.callback.SpringPlainTextPasswordValidationCallbackHandler"> <property name="authenticationManager" ref="authenticationManager"/> </bean>

于 2013-09-24T12:39:24.310 回答