Improved: Internal SSO: adds more time to compensate for possible time difference

This commit is contained in:
Jacques Le Roux
2020-04-15 15:08:43 +02:00
parent e0c8a1f4b0
commit 98f6d7ea8d
@@ -402,9 +402,11 @@ public class CommonEvents {
String securedUserLoginId = LoginWorker.getSecuredUserLoginId(request);
if (securedUserLoginId != null) {
types.put("userLoginId", securedUserLoginId);
// 10 seconds seems plenty enough OOTB. Custom projects might want set a lower value.
// 30 seconds seems plenty enough OOTB to compensate for possible time difference
// If you cross issue with this value you should use the same NTP server for both sides
// Custom projects might want set a lower value for security reason
int ttlSeconds = (int) Long.parseLong(EntityUtilProperties.getPropertyValue("security",
"security.jwt.token.expireTime", "10", delegator));
"security.jwt.token.expireTime", "30", delegator));
String token = JWTManager.createJwt(delegator, types, ttlSeconds);
writeJSONtoResponse(JSON.from(token), request, response);
} else {