1
votes

I was able to configure shiro.ini for mariadb. How shall i configure shiro.ini for MongoDB?

I have tried configuring for mariadb, which is working fine.

jdbcRealm = org.apache.shiro.realm.jdbc.JdbcRealm
jdbcRealm.permissionsLookupEnabled = false

jdbcRealm.authenticationQuery = SELECT Password FROM User WHERE Name = ?

ds = org.mariadb.jdbc.MariaDbDataSource
ds.serverName = localhost
ds.user = xxxx
ds.password = xxxx
ds.databaseName = xxxx
jdbcRealm.dataSource = $ds

securityManager.realms = $jdbcRealm
securityManager.sessionManager.globalSessionTimeout = 6000

Unable to get datasource and realm for mongoDB.

1

1 Answers

0
votes

You would either need to use a Mongo JDBC lib, or create a custom realm with a Mongo client. There are also a few Shiro Mongo Realms in the community.