SimpleAuthenticationSuccessHandler successHandler = new SimpleAuthenticationSuccessHandler();
successHandler.setDefaultTargetUrl(confMap.get("security.signin_success"));
successHandler.setTargetUrlParameter(confMap.get("security.returnto"));
successHandler.setUseReferer(true);
SimpleUrlAuthenticationFailureHandler failureHandler = new SimpleUrlAuthenticationFailureHandler();
failureHandler.setDefaultFailureUrl(confMap.get("security.signin_failure"));
TokenBasedRememberMeServices tbrms = new TokenBasedRememberMeServices(Config.APP_SECRET_KEY, new SimpleUserService());
tbrms.setAlwaysRemember(true);
tbrms.setTokenValiditySeconds(Config.SESSION_TIMEOUT_SEC.intValue());
tbrms.setCookieName(Config.AUTH_COOKIE);