You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Michael Chandler <Mi...@onassignment.com> on 2013/07/01 17:47:54 UTC

RE: Multiple realms with Spring

Les,

Perfect!!!  Thank you sir!

Mike

From: Les Hazlewood [mailto:lhazlewood@apache.org]
Sent: Friday, June 28, 2013 5:19 PM
To: user@shiro.apache.org
Subject: Re: Multiple realms with Spring

Hi Mike,

<bean id="securityManager" ...
    <property name="realms">
        <list>
            <bean ref="realm1"/>
            <bean ref="realm2"/>
            ...
        </list>
    </property>
</bean>

HTH,

--
Les Hazlewood | @lhazlewood
CTO, Stormpath | http://stormpath.com<http://stormpath.com/> | @goStormpath | 888.391.5282

On Fri, Jun 28, 2013 at 8:52 AM, Michael Chandler <Mi...@onassignment.com>> wrote:
Hi there!

I'm trying to set multiple realms in my configuration via Spring and the docs show me how to set up a single realm configuration as follows:

<bean id="myRealm" class="...">
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
                <property name="realm" ref="myRealm" />
</bean>

Can anyone tell me how to set up multiple realms?

In the JavaDocs, I can see that Security Manager classes have a setRealms() method for a Collection of Realm objects in addition to the single setRealm() method, but I'm unsure of how to leverage that in the applicationContext XML config.  I'm sure this has more to do with my lack of experience with Spring than a problem with the documentation, by the way.

Any ideas?

Regards,

Mike Chandler