GitHub user sctincman opened a pull request: https://github.com/apache/zeppelin/pull/2453
[ZEPPELIN-2659] Let WebEnvironment initialize SecurityManager. ### What is this PR for? This commit disables generating a Shiro `SecurityManager` from the `IniSecurityManagerFactory`, and instead let's the `WebEnvironment` instantiate the `SecurityManager`. The `initParameter` "staticSecurityManagerEnabled" ensures this `SecurityManager` is set and available for use. Overall, this prevents the double parsing of `shiro.ini`, which can cause double instantiation. This is particularly thorny with things like EHCache, which need uniquely named caches, and will throw an exception if a cache with the same name already exists. ### What type of PR is it? [Bug Fix ] ### Todos ### What is the Jira issue? [ZEPPELIN-2659](https://issues.apache.org/jira/browse/ZEPPELIN-2659) ### How should this be tested? - Enable Shiro by copying the shiro.ini.template to shiro.ini. Attempt logging in as a user. - Enable WebSessions and EHCache by adding the following lines to the `[main]` section of shiro.ini, and attempt logging in. ``` [main] ... sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager securityManager.sessionManager = $sessionManager sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO securityManager.sessionManager.sessionDAO = $sessionDAO cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager securityManager.cacheManager = $cacheManager ``` ### Screenshots (if appropriate) ### Questions: * Does the licenses files need update? * No. * Is there breaking changes for older versions? * No. * Does this needs documentation? * No. You can merge this pull request into a Git repository by running: $ git pull https://github.com/sctincman/zeppelin ZEPPELIN-2659 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/zeppelin/pull/2453.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2453 ---- commit d4e0979a3eaf95cb0c0f3db38398c2ffbe9ce58d Author: Jonathan Tinkham <jonathantink...@fico.com> Date: 2017-06-29T21:33:05Z ZEPPELIN-2659 Let WebEnvironment initialize SecurityManager. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---