Dont think you can switch auth on the fly.

Create a 2nd https component, eg <bean id="https2"> and use that as
component name.


On Tue, Aug 12, 2014 at 4:40 PM, rickaroni <rgfa...@directv.com> wrote:
> Hi,
>
> I have a route with two different http calls in it, each with different
> security requirements.
>
> How can I configure a recipientList such that it uses an HttpConfiguration
> defined elsewhere as shown below?
>
> Namely, here is an example that doesn't recognize the HttpComponent inside
> the https bean in the recipientList.  It only works if I ignore specify the
> basic auth parameters in the uri inside the recipientList.
>
>
>
>     <bean id="myhttpsAuth"
> class="org.apache.camel.component.http.HttpConfiguration">
>         <property name="authMethod" value="Basic"/>
>         <property name="authUsername" value="{{my.basicAuth.user}}"/>
>         <property name="authPassword" value="{{my.basicAuth.password}}"/>
>     </bean>
>
>     <bean id="https" class="org.apache.camel.component.http.HttpComponent">
>         <property name="httpConfiguration" ref="myhttpsAuth"/>
>     </bean>
>
> and later...
>
> <routeContext id="my-route" xmlns="http://camel.apache.org/schema/spring";>
>
>
>     <recipientList>
> <simple>https://${in.headers[MY_SERVER_AND_PORT]}/rest/accounts/account/${in.headers[ACCOUNT_NUMBER]}/doSomethingToMyAccount</simple>
>     </recipientList>
>
>
>     <recipientList>
> <simple>https://${in.headers[MY_SERVER_AND_PORT]}/rest/accounts/account/${in.headers[ACCOUNT_NUMBER]}/doSomethingToMyAccount?authMethod=Basic&amp;authUsername={{my.basicAuth.user}}&amp;authPassword={{my.basicAuth.password}}</simple>
>     </recipientList>
>
>
> Many thanks for any help you can offer!
>
> Rick
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-can-I-make-a-RecipientList-http-component-use-an-HttpConfiguration-tp5755116.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to