gpt4 book ai didi

java - 具有安全性的 Spring-ws UnsupportedCallbackException

转载 作者:行者123 更新时间:2023-12-01 04:33:32 26 4
gpt4 key购买 nike

在 SpringWS 的 spring security 中,我正在使用

<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;
}
}

可能出了什么问题,请帮忙

谢谢

最佳答案

使用以下回调:

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

关于java - 具有安全性的 Spring-ws UnsupportedCallbackException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17629609/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com