My requirement is to read user and permission information from the database to complete authentication and authorization. Shiro provides JdbcRealm implementation, but there is no MongoDB realm implementation.
Could you please:
Is MongoDB implemented as a Shiro realm?
If possible, how to write the specific configuration? (Google found a specific implementation code, but the relevant configuration files are missing)
谢邀, 你只需要实现自己的Realm就行, 比如:
然后把你自己的
Realm
设置到RealmSecurityManager
中, 比如:然后把这个
SecurityManager
设置到ShiroFilter
中就行, 比如: