This project will provide Ehcache 3 support in Apache Shiro
To enable it in Shiro application use the following configuration:
[main]
cacheManager = org.ehcache.integrations.shiro.EhcacheShiroManager
securityManager.cacheManager = $cacheManager
To set custom Ehcache configuration file use the following configuration:
[main]
cacheManager = org.ehcache.integrations.shiro.EhcacheShiroManager
cacheManager.cacheManagerConfigFile = /path/to/custom/configuration.xml
securityManager.cacheManager = $cacheManager
By default the CacheManager
uses default Shiro specific EhCache configuration.
If you wish to change the cache settings, or configure your own ehcache.xml
or org.ehcache.CacheManager
instance, you will need to configure the cache region to ensure that Sessions are handled correctly.
You have to ensure that you have defined cache named shiro-activeSessionCache
for Shiro’s needs.
Please have a look at the default configuration file before creating your own.
<dependency>
<groupId>org.ehcache.integrations.shiro</groupId>
<artifactId>shiro-ehcache3</artifactId>
<version>1.0.0</version>
</dependency>
This project works with Shiro 1.1.0
and above and requires Ehcache 3.1.3
and above.
Official Shiro documentation for: