KEYCLOAK-695 Let KEYCLOAK_REMEMBER_ME cookie to be valid for 1 year

This commit is contained in:
mposolda 2014-09-18 11:03:44 +02:00
parent 95233af485
commit 89471b7db1

View file

@ -119,9 +119,9 @@ public class AuthenticationManager {
public void createRememberMeCookie(RealmModel realm, String username, UriInfo uriInfo, ClientConnection connection) { public void createRememberMeCookie(RealmModel realm, String username, UriInfo uriInfo, ClientConnection connection) {
String path = getIdentityCookiePath(realm, uriInfo); String path = getIdentityCookiePath(realm, uriInfo);
boolean secureOnly = realm.getSslRequired().isRequired(connection); boolean secureOnly = realm.getSslRequired().isRequired(connection);
// remember me cookie should be persistent (hardcoded to 1 month for now) // remember me cookie should be persistent (hardcoded to 365 days for now)
//NewCookie cookie = new NewCookie(KEYCLOAK_REMEMBER_ME, "true", path, null, null, realm.getCentralLoginLifespan(), secureOnly);// todo httponly , true); //NewCookie cookie = new NewCookie(KEYCLOAK_REMEMBER_ME, "true", path, null, null, realm.getCentralLoginLifespan(), secureOnly);// todo httponly , true);
CookieHelper.addCookie(KEYCLOAK_REMEMBER_ME, username, path, null, null, 2592000, secureOnly, true); CookieHelper.addCookie(KEYCLOAK_REMEMBER_ME, username, path, null, null, 31536000, secureOnly, true);
} }
protected String encodeToken(RealmModel realm, Object token) { protected String encodeToken(RealmModel realm, Object token) {