Basic Authentication with cxfendpoint in camel aries blueprint

132 Views Asked by At

I have a cxf bean defined in a aries blueprint file xml and I want to call it from outside using basic authentication. Camel version is 2.15.1.redhat-621084. I have the following xml:

    <?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:camel="http://camel.apache.org/schema/blueprint"
           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
           xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
           xmlns:cxfcore="http://cxf.apache.org/blueprint/core"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 
                        https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd 
                        http://camel.apache.org/schema/blueprint 
                        http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">

    <cxf:cxfEndpoint id="myCxf"
                     address="http://0.0.0.0:57559/service"
                     serviceClass="com.example.PortType">
        <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD"/>
        </cxf:properties>
    </cxf:cxfEndpoint>
    <camelContext id="id1" autoStartup="true" trace="false" useMDCLogging="false"
                  xmlns="http://camel.apache.org/schema/blueprint">

        <route>
            <from id="f1" uri="cxf:bean:myCxf?username=admin&amp;password=admin"/>
            <to uri="log:request"/>
        </route>
    </camelContext>
</blueprint>

The problem is that username and password are skipped, so I am able to call my service without credentials. How can I perform Basic Authentication with cxf?

0

There are 0 best solutions below