Project

General

Profile

Actions

Defect #1924

closed

Task PasswordExpirationWarningTaskExecutor was sended day after

Added by Ondřej Kopr over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Radek Tomiška
Category:
Password
Target version:
Start date:
11/08/2019
Due date:
% Done:

100%

Estimated time:
Affected versions:
Owner:

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

pass01.png (17.5 KB) pass01.png Ondřej Kopr, 11/08/2019 09:54 AM
pass02.png (36.8 KB) pass02.png Ondřej Kopr, 11/08/2019 09:55 AM
pass03.png (33.2 KB) pass03.png Ondřej Kopr, 11/08/2019 09:56 AM
Actions #1

Updated by Ondřej Kopr over 4 years ago

  • Category set to Password
Actions #2

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
Actions #3

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?

Actions #4

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.

Actions #5

Updated by Vít Švanda over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF