use of org.apache.shiro.web.mgt.CookieRememberMeManager in project shiro by apache.
the class SampleShiroNativeSessionsServletModule 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 nutzboot by nutzam.
the class ShiroEnvStarter method createRememberMeManager.
@IocBean(name = "shiroRememberMeManager")
public RememberMeManager createRememberMeManager() {
CookieRememberMeManager rememberMeManager = new CookieRememberMeManager();
rememberMeManager.setSerializer(new SimplePrincipalSerializer());
SimpleCookie cookie = new SimpleCookie();
cookie.setName("rememberMe");
cookie.setHttpOnly(true);
rememberMeManager.setCookie(cookie);
return rememberMeManager;
}
use of org.apache.shiro.web.mgt.CookieRememberMeManager in project vip by guangdada.
the class ShiroConfig method rememberMeManager.
/**
* rememberMe管理器, cipherKey生成见{@code Base64Test.java}
*/
@Bean
public CookieRememberMeManager rememberMeManager(SimpleCookie rememberMeCookie) {
CookieRememberMeManager manager = new CookieRememberMeManager();
manager.setCipherKey(Base64.decode("Z3VucwAAAAAAAAAAAAAAAA=="));
manager.setCookie(rememberMeCookie);
return manager;
}
use of org.apache.shiro.web.mgt.CookieRememberMeManager in project wechat by dllwh.
the class ShiroConfig method rememberMeManager.
/**
* @方法描述 : rememberMe管理器
* @param rememberMeCookie
* @return
*/
// @Bean
public CookieRememberMeManager rememberMeManager() {
CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager();
cookieRememberMeManager.setCookie(rememberMeCookie());
// cookieRememberMeManager.setCipherKey();
return cookieRememberMeManager;
}
use of org.apache.shiro.web.mgt.CookieRememberMeManager in project Spring-Family by Sierou-Java.
the class ShiroConfiguration method rememberMeManager.
/**
* cookie管理对象;
* @return
*/
@Bean
public CookieRememberMeManager rememberMeManager() {
System.out.println("ShiroConfiguration.rememberMeManager()");
CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager();
cookieRememberMeManager.setCookie(rememberMeCookie());
return cookieRememberMeManager;
}
Aggregations