use of org.apache.shiro.web.mgt.CookieRememberMeManager in project shiro by apache.
the class SampleShiroServletModule method bindWebSecurityManager.
@Override
protected void bindWebSecurityManager(AnnotatedBindingBuilder<? super WebSecurityManager> bind) {
try {
String cipherKey = loadShiroIni().getSectionProperty("main", "securityManager.rememberMeManager.cipherKey");
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
CookieRememberMeManager rememberMeManager = new CookieRememberMeManager();
rememberMeManager.setCipherKey(Base64.decode(cipherKey));
securityManager.setRememberMeManager(rememberMeManager);
bind.toInstance(securityManager);
} catch (MalformedURLException e) {
// super.bindWebSecurityManager(bind) if you do not need rememberMe functionality
throw new ConfigurationException("securityManager.rememberMeManager.cipherKey must be set in shiro.ini.");
}
}
use of org.apache.shiro.web.mgt.CookieRememberMeManager in project shiro by apache.
the class AbstractShiroWebConfiguration method rememberMeManager.
protected RememberMeManager rememberMeManager() {
CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager();
cookieRememberMeManager.setCookie(rememberMeCookieTemplate());
return cookieRememberMeManager;
}
Aggregations