对于 SOAP Web 服务,我有一个PasswordDigest
通过camel-cxf
和进行身份验证的配置示例WSS4J
:
<camel-cxf:cxfEndpoint id="myService"
address="${ws.endpoint.address}"
serviceName="es:MyService"
wsdlURL="wsdl/myservice.wsdl"
endpointName="es:MyServicePort"
serviceClass="com.us.MyServiceEndpoint"
xmlns:es="http://us.com/services/MyService">
<camel-cxf:inInterceptors>
<bean class="org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JInInterceptor">
<property name="properties">
<map>
<entry key="action" value="UsernameToken"/>
<entry key="passwordType" value="PasswordDigest"/>
<entry key="passwordCallbackRef" value-ref="myPasswordCallback"/>
</map>
</property>
</bean>
</camel-cxf:inInterceptors>
</camel-cxf:cxfEndpoint>
我们有一个请求为 BASIC 身份验证启用相同的资源 - 如何修改此配置来做到这一点?
我更改了以下行并通过 SOAP UI 进行了测试:
<entry key="passwordType" value="PasswordText"/>
然而,结果是来自以下的 SOAP 错误UsernameTokenValidator.java
:
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>These policy alternatives can not be satisfied:
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}
UsernameToken: Password hashing policy not enforced</faultstring>
</soap:Fault>
如果有人在这里有一些指导,将不胜感激。