We have a little problem with Apache Shiro.
We are using Shiro with a JDBC realm: users, roles, and permissions are stocked in our SQL server database.
We have a java application used as a backoffice to insert, update or delete users, roles and permissions. But we need to do the same with Urls filters.
I found a few things about it, but i’m really a beginner with Shiro and i don’t understand them, and often, the examples are whith servlets and JSP (we are only using HTML/CSS/JS and data are collected with web services).
Is anybody can explain how to stocked urls and filter in a database, and not in an INI file?
Shiro uses a default implementation of the FilterChainManager interface to manage and create Filters. You could create a custom implementation of this interface to delegate to your database for config information. See the DefaultFilterChainManager implementation for ideas.
Here’s how this stuff works at runtime:
ShiroFilter.FilterChainthat should execute for any given request.FilterChainResolver, a PathMatchingFilterChainResolver implementation in turn inspects the request path and uses that to perform a lookup with theFilterChainManager.ShiroFilter.You can plugin any
FilterChainResolveryou wish into theShiroFilter. You can use the defaultFilterChainResolverand have it delegate to your customFilterChainManagerinstance, or you can implement either (or both) interfaces as your needs may require.