Hi Tim, The realm config looks good to me - perhaps configuring the DataSource is where the problem is? What kind of error are you getting?
In regards to JNDI lookups, we have a JndiRealmFactory that can look up entire Realms from JNDI, but we don't have a generic JndiObjectFactory that can look up any type of object. This would be really easy for us to implement (and I will have a need of this myself in the next few weeks I think), so I created the following Jira issue to track it: https://issues.apache.org/jira/browse/SHIRO-217 <https://issues.apache.org/jira/browse/SHIRO-217>Please feel free to watch/vote for it if this would be valuable for you. Regards, -- Les Hazlewood Founder, Katasoft, Inc. Application Security Products & Professional Apache Shiro Support and Training: http://www.katasoft.com On Wed, Nov 10, 2010 at 2:02 AM, Timothy Sparg < [email protected]> wrote: > Hi all I’m trying to use the jdbcRealm of Shiro, but I seem to be > configuring it incorrectly. > > > > > > <filter> > > <filter-name>ShiroFilter</filter-name> > > > <filter-class>org.apache.shiro.web.servlet.IniShiroFilter</filter-class> > > <init-param> > > <param-name>config</param-name> > > <param-value> > > [main] > > coreFreightRealm = org.apache.shiro.realm.jdbc.JdbcRealm > > coreFreightRealm.permissionsLookupEnabled = true > > coreFreightRealm.authenticationQuery = "SELECT password > FROM User WHERE userCode = ?" > > coreFreightRealm.userRolesQuery = "SELECT ActorCode FROM > UserActor WHERE UserCode = ?" > > coreFreightRealm.permissionsQuery = "SELECT ActorDesc FROM > actor WHERE ActorCode = ?" > > > > ds = com.microsoft.sqlserver.jdbc.SQLServerDataSource > > ds.serverName = databaseServer > > ds.user = user > > ds.password = password > > ds.portNumber = 1433 > > ds.databaseName = development > > coreFreightRealm.dataSource = $ds > > </param-value> > > </init-param> > > </filter> > > > > > > > > Can somebody see what I’m doing wrong? > > > > And on another note would it be possible to use a jndi resource instead of > having to configure the database manually? > > > > Thanks > > Tim >
