Last active
December 15, 2015 05:39
-
-
Save prb/5211125 to your computer and use it in GitHub Desktop.
Minimal integration of Shiro as a filter in front of a Dropwizard application.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
environment.setSessionHandler(new SessionHandler()); | |
AbstractShiroFilter sf = new AbstractShiroFilter() { }; | |
IniWebEnvironment iwe = new IniWebEnvironment(); | |
iwe.init(); | |
sf.setSecurityManager(iwe.getWebSecurityManager()); | |
sf.setFilterChainResolver(iwe.getFilterChainResolver()); | |
environment.addFilter(sf,"/*").setName("shiro-filter"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Presumes use of
.ini
-style configuration in one of the usual locations. ExtendsAbstractShiroFilter
to get a concrete class without the dependence on hardwired initialization that comes withShiroFilter
.