Source:
private boolean attachUserToSession(AuthenticationProfile profile, ExtMap authRecord, ExtMap principalRecord) { try { byte s[] = new byte[64]; SecureRandom.getInstance("SHA1PRNG").nextBytes(s); engineSessionId = new Base64(0).encodeToString(s); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } SessionDataContainer.getInstance().setUser(engineSessionId, getCurrentUser()); SessionDataContainer.getInstance().refresh(engineSessionId); SessionDataContainer.getInstance().setAuthn(engineSessionId, profile.getAuthn()); SessionDataContainer.getInstance().setAuthRecord(engineSessionId, authRecord); SessionDataContainer.getInstance().setPrincipal(engineSessionId, authRecord.<String>get(Authn.AuthRecord.PRINCIPAL)); SessionDataContainer.getInstance().setPrincipalRecord(engineSessionId, principalRecord); SessionDataContainer.getInstance().persistEngineSession(engineSessionId); if (getParameters().getPassword() != null) { SessionDataContainer.getInstance().setPassword(engineSessionId, getParameters().getPassword()); } int userSessionHardLimit = Config.<Integer> getValue(ConfigValues.UserSessionHardLimit); Date validTo = userSessionHardLimit != 0 ? DateUtils.addMinutes(new Date(), userSessionHardLimit) : null; if (authRecord.<String> get(AuthRecord.VALID_TO) != null) { try { Date fromExtension = new SimpleDateFormat("yyyyMMddHHmmssZ").parse(authRecord.<String> get(AuthRecord.VALID_TO)); if (validTo != null) { validTo = validTo.compareTo(fromExtension) < 0 ? validTo : fromExtension; } else { validTo = fromExtension; } } catch (ParseException e) { log.warn("Error parsing AuthRecord.VALID_TO. Default VALID_TO value will be set on session: {}", e.getMessage()); log.debug("Exception", e); } } SessionDataContainer.getInstance().setHardLimit(engineSessionId, validTo); return true; }

Target:
private boolean attachUserToSession(AuthenticationProfile profile, ExtMap authRecord, ExtMap principalRecord) { try { byte s[] = new byte[64]; SecureRandom.getInstance("SHA1PRNG").nextBytes(s); engineSessionId = new Base64(0).encodeToString(s); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } SessionDataContainer.getInstance().setUser(engineSessionId, getCurrentUser()); SessionDataContainer.getInstance().refresh(engineSessionId); SessionDataContainer.getInstance().setAuthn(engineSessionId, profile.getAuthn()); SessionDataContainer.getInstance().setAuthRecord(engineSessionId, authRecord); SessionDataContainer.getInstance().setPrincipal(engineSessionId, authRecord.<String>get(Authn.AuthRecord.PRINCIPAL)); SessionDataContainer.getInstance().setPrincipalRecord(engineSessionId, principalRecord); if (getParameters().getPassword() != null) { SessionDataContainer.getInstance().setPassword(engineSessionId, getParameters().getPassword()); } int userSessionHardLimit = Config.<Integer> getValue(ConfigValues.UserSessionHardLimit); Date validTo = userSessionHardLimit != 0 ? DateUtils.addMinutes(new Date(), userSessionHardLimit) : null; if (authRecord.<String> get(AuthRecord.VALID_TO) != null) { try { Date fromExtension = new SimpleDateFormat("yyyyMMddHHmmssZ").parse(authRecord.<String> get(AuthRecord.VALID_TO)); if (validTo != null) { validTo = validTo.compareTo(fromExtension) < 0 ? validTo : fromExtension; } else { validTo = fromExtension; } } catch (ParseException e) { log.warn("Error parsing AuthRecord.VALID_TO. Default VALID_TO value will be set on session: {}", e.getMessage()); log.debug("Exception", e); } } SessionDataContainer.getInstance().setHardLimit(engineSessionId, validTo); return true; }