Shiro grails 插件 - 配置
使用 ehcache+terracotta 设置 shiro 会话缓存,将这些配置放入 config.groovy -
security.shiro.sessionDAO = "org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO"
// 此名称与 ehcache 中的缓存名称匹配。 xml: security.shiro.sessionDAO.activeSessionsCacheName = "shiro-activeSessionsCache" security.shiro.securityManager.sessionManager.sessionDAO = "org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO"
// 配置 EhCacheManager: security.shiro.cacheManager = "org.apache.shiro.cache.ehcache.EhCacheManager" security.shiro.cacheManager.cacheManagerConfigFile = "classpath:session_ehcache.xml"
// 在Shiro的SecurityManager上配置上面的CacheManager // 使用它来满足 Shiro 的所有缓存需求: security.shiro.securityManager.cacheManager = "org.apache.shiro.cache.ehcache.EhCacheManager"
但看起来 shiro 插件没有读取配置,已使用“security.shiro”作为前缀
提前致谢
setting up shiro session cache with ehcache+terracotta ,putitng these configs in config.groovy -
security.shiro.sessionDAO = "org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO"
// This name matches a cache name in ehcache.xml:
security.shiro.sessionDAO.activeSessionsCacheName = "shiro-activeSessionsCache"
security.shiro.securityManager.sessionManager.sessionDAO = "org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO"
// Configure The EhCacheManager:
security.shiro.cacheManager = "org.apache.shiro.cache.ehcache.EhCacheManager"
security.shiro.cacheManager.cacheManagerConfigFile = "classpath:session_ehcache.xml"
// Configure the above CacheManager on Shiro's SecurityManager
// to use it for all of Shiro's caching needs:
security.shiro.securityManager.cacheManager = "org.apache.shiro.cache.ehcache.EhCacheManager"
but looks like shiro plugin is not reading configurations, have used "security.shiro" as prefix
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发现这可以通过一种方式完成 -
1.在
resources.groovy
配置(覆盖插件定义)正确的 shiroSecurityManager bean:或
2.在
Bootstrap.groovy
配置 shiroSecurityManager >@
Config.groovy
把 -Figured out this could be done either of one way -
1.Configure (override over plugin definition) proper shiroSecurityManager bean at
resources.groovy
:OR
2.Configure shiroSecurityManager at
Bootstrap.groovy
@
Config.groovy
put -