blob: b55d4a86df3355873c125f4721b2f99d54680275 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf.xsd
http://camel.apache.org/schema/spring-security
http://camel.apache.org/schema/spring-security/camel-spring-security.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">
<!-- import the spring security configuration -->
<import resource="classpath:org/apache/camel/itest/security/commonSecurity.xml"/>
<authorizationPolicy id="admin" access="ROLE_ADMIN"
authenticationAdapter="myAuthenticationAdapter"
authenticationManager="authenticationManager"
accessDecisionManager="accessDecisionManager"
xmlns="http://camel.apache.org/schema/spring-security"/>
<bean id="myAuthenticationAdapter" class="org.apache.camel.itest.security.MyAuthenticationAdapter"/>
<bean id="myProcessor" class="org.apache.camel.itest.security.MyProcessor"/>
<camelContext id="myCamelContext" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="cxf:bean:UsernameTokenEndpoint"/>
<!-- The exchange should be authenticated with the role of ADMIN before it is send to mock:endpoint -->
<policy ref="admin">
<process ref="myProcessor"/>
</policy>
</route>
</camelContext>
<!--
UsernameToken endpoint definition
This endpoint is configured to read the username and password tokens
and validate them using a password callback handler.
-->
<cxf:cxfEndpoint
id="UsernameTokenEndpoint"
wsdlURL="wsdl/hello_world.wsdl"
serviceClass="org.apache.hello_world_soap_http.Greeter"
endpointName="s:SoapOverHttp"
serviceName="s:SOAPService"
xmlns:s="http://apache.org/hello_world_soap_http"
address="http://localhost:9000/SoapContext/SoapPort"
>
<cxf:inInterceptors>
<ref bean="UsernameToken_Request"/>
<!-- bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/-->
</cxf:inInterceptors>
</cxf:cxfEndpoint>
<!--
WSS4JInInterceptor for UsernameTokenEndpoint above
-->
<bean
id="UsernameToken_Request"
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor"
>
<constructor-arg>
<map>
<entry key="action" value="UsernameToken"/>
<entry key="passwordType" value="PasswordText"/>
<entry key="passwordCallbackClass" value="org.apache.camel.itest.security.KeystorePasswordCallback"/>
</map>
</constructor-arg>
</bean>
</beans>