You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "Les Hazlewood (JIRA)" <ji...@apache.org> on 2011/01/17 23:29:45 UTC
[jira] Resolved: (SHIRO-238) RealmFactory not working properly
[ https://issues.apache.org/jira/browse/SHIRO-238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Les Hazlewood resolved SHIRO-238.
---------------------------------
Resolution: Fixed
Fix committed to trunk. Thanks!
> RealmFactory not working properly
> ---------------------------------
>
> Key: SHIRO-238
> URL: https://issues.apache.org/jira/browse/SHIRO-238
> Project: Shiro
> Issue Type: Bug
> Components: Configuration
> Affects Versions: 1.1.0
> Reporter: jontro
> Assignee: Les Hazlewood
>
> Im trying to use a realmFactory to register a realm.
> The config is quite simple:
> [main]
> realmFactory = se.example.init.MyRealmFactory
> authc.loginUrl = /
> After debugging the problem I stumbled upon the following lines in
> org.apache.shiro.config.IniSecurityManagerFactory (Line 173 in version 1.1.0)
> private void addToRealms(Collection<Realm> realms, RealmFactory factory) {
> LifecycleUtils.init(factory);
> Collection<Realm> factoryRealms = factory.getRealms();
> if (!CollectionUtils.isEmpty(realms)) {
> realms.addAll(factoryRealms);
> }
> }
> Changing
> if (!CollectionUtils.isEmpty(realms)) {
> to
> if (!CollectionUtils.isEmpty(factoryRealms)) {
> solves the problem.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.