Search code examples
apache-camelrestletrestlet-2.0

Adding Authorization Header with Camel restlet component


I've been using restlet camel component to communicate with endpoints fine for a couple of weeks now, but after I had the need to add an Authorization header to my requests, that's when I kept getting this warning:

WARNING: Addition of the standard header "Authorization" is not allowed. Please use the equivalent property in the Restlet API.

Which blocks the header from being added to the outgoing message. I've seen solutions for this for using restlet, but I don't have the luxury when using it as a camel component.

I've tried using the org.restlet.http.headers attribute but still get the same message.

Any ideas how to make it send out my authorization header? (I would rather not use the http component)

Note: I'm using Camel 2.19.2, same version for restlet


Solution

  • There is a ticket at Restlet to support this, however they have not implemented this: https://github.com/restlet/restlet-framework-java/issues/1198

    There is also a Camel ticket: https://issues.apache.org/jira/browse/CAMEL-10665

    As it seems Restlet takes forever to fix this on their side, we may have to bit the bullet and make a special fix in the camel-restlet component