Defect #1924
closedTask PasswordExpirationWarningTaskExecutor was sended day after
100%
Description
The long running task PasswordExpirationWarningTaskExecutor has parameter daysBefore. When we set this parameter to 1 and run this task the lrt will process all items that has expiration today not tomorrow.
The combination with LRT PasswordExpiredTaskExecutor is user notified that password will be expired in one day and the task PasswordExpiredTaskExecutor will notified that password is already expired.
I simulated this with set password to this validity:
select p.id, p.valid_from, p.valid_till from idm_password p where p.identity_id = (select i.id from idm_identity i where i.username = 'passwordExpiration');
Then I run LRT PasswordExpirationWarningTaskExecutor (daysBefore=1) and PasswordExpiredTaskExecutor. Both LRT process same password and send notification:
Affected version:
Files
Updated by Radek Tomiška over 4 years ago
- Status changed from New to In Progress
- Assignee set to Radek Tomiška
- Target version set to 10.0.0
- % Done changed from 0 to 50
Updated by Radek Tomiška over 4 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Radek Tomiška to Vít Švanda
- % Done changed from 50 to 90
The issue was related to ''PasswordExpiredTaskExecutor'' - notification and publishing PASSWORD_EXPIRED event occurs event for password with valid till today (find passwords with validTill <= today). I fixed this lrt - notification and publishing PASSWORD_EXPIRED event occurs just for passwords with validTill < today.
It's good to schedule ''PasswordExpiredTaskExecutor'' and ''PasswordExpirationWarningTaskExecutor'' on the start of day - e.g. '0 5 0 ? * *' => passwords which expired yesterday will be processed and proper notifications will be send. ''PasswordExpiredTaskExecutor'' is scheduled by default this way from now (v10).
Doc updated:
https://wiki.czechidm.com/devel/documentation/application_configuration/dev/scheduled_tasks/task-scheduler#passwordexpiredtaskexecutor
https://github.com/bcvsolutions/CzechIdMng/blob/develop/CHANGELOG.md#1000
Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/ad82537b2d93077ed25f5dcf10812e2f1ad2c891
Workaround for CzechIdM version <= 9.7.x:
- schedule ''PasswordExpiredTaskExecutor'' on the end of day - e.g. '0 55 0 ? * *'
- schedule ''PasswordExpirationWarningTaskExecutor'' on the start of day - e.g. '0 5 0 ? * *'
=> password warning and expiration will work as expected.
Could you do a feedback, please?
Updated by Vít Švanda over 4 years ago
- Status changed from Needs feedback to Resolved
- Assignee changed from Vít Švanda to Radek Tomiška
- % Done changed from 90 to 100
I did review and test. It was hard to understand and simulated this case, but notifications works correctly now. Thanks for that.