camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: How can Shiro be used with camel to limit access to a route?
Date Fri, 06 Apr 2012 09:01:15 GMT
On Fri, Apr 6, 2012 at 10:36 AM, mgiammarco <> wrote:
> 2012/4/6, Claus Ibsen-2 [via Camel] <>:
>> On Thu, Apr 5, 2012 at 8:54 PM, mgiammarco <> wrote:
>>> Ok I have found the bug:
>>> ShiroSecurityTokenInjector creates a bytearray and puts it in the message
>>> header.
>>> The bytearray do not pass through openwire...
>> Ah crap, yeah JMS spec have limitations on what can be transfered over
>> JMS in JMS properties.
>> We have some notes about this at the Camel JMS wiki page
>> I wonder if we can always safely convert the shiro token as a String
>> representation instead of byte[]?
>> A string is always supported.
>> I dont assume we need to base encode the byte array or something? The
>> token may already be representable out of the box in a String.
>> Maybe you could check a bit on Shiro and see about this about the
>> token? And if possible we could maybe adjust the code in camel-shiro.
> Ok I was optimist about toString().
> To make all things work I do this:
> from ByteSource get byte[]
> encode the token to base64 (using apache commons codec)
> send it to jms
> decode from base64
> new ByteSource( byte[] decoded)
> put it in the shiro token header
> Then all works.

Cool. Do you do request/reply over JMS or something?

I noticed there is a toBase64() method on org.apache.shiro.util.ByteSource
so you may have this out of the box.

So it could be a matter of having type converter from String ->
and the reverse converter.

> Mario
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
CamelOne 2012 Conference, May 15-16, 2012:
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message