Skip to content

Return false from expired_for_interval? if the last auth event was not a remember device event#9458

Merged
jmhooper merged 2 commits intomainfrom
jmhooper-return-false-expired-for-interval-for-other-auth-method
Oct 26, 2023
Merged

Return false from expired_for_interval? if the last auth event was not a remember device event#9458
jmhooper merged 2 commits intomainfrom
jmhooper-return-false-expired-for-interval-for-other-auth-method

Conversation

@jmhooper
Copy link
Contributor

The remember device concern is used to check if the remember device interval is expired requiring a user to re-authenticate. That check is performed on these lines:

before_action :redirect_to_reauthenticate, only: :auth, if: :remember_device_expired_for_sp?

before_action :redirect_to_reauthenticate, only: :index, if: :remember_device_expired_for_sp?

It looks like the expired_for_interval? was recently changed to return true if remember device was used at any point and is now expired (ref: https://github.com/18F/identity-idp/pull/9335/files#diff-82060fb86bc64910b8186479a6f620e6ba44b007ca059e082c468f29702cf142R56). As a result, a user is prompted to re-authenticate if their remember device session is expired, regardless of whether they have already re-authenticated.

This commit reverts to the original behavior to address this bug.

… was a remember device event

The remember device concern is used to check if the remember device interval is expired requiring a user to reauthenticate. That check is performed on these lines:

https://github.com/18F/identity-idp/blob/f8ee126760a802eaa33de4d0786c120c50f16961/app/controllers/saml_idp_controller.rb#L24C29-L24C29

https://github.com/18F/identity-idp/blob/f8ee126760a802eaa33de4d0786c120c50f16961/app/controllers/openid_connect/authorization_controller.rb#L21

It looks like the `expired_for_interval?` was recently changed to return true if remember device was used at any point and is now expired (ref: https://github.com/18F/identity-idp/pull/9335/files#diff-82060fb86bc64910b8186479a6f620e6ba44b007ca059e082c468f29702cf142R56). As a result, a user is prompted to re-authenticate if their remember device session is expired, regardless of whether they have already re-authenticated.

This commit reverts to the original behavior to address this bug.

[skip changelog]
@jmhooper jmhooper requested a review from aduth October 26, 2023 14:49
@jmhooper jmhooper merged commit 048e61c into main Oct 26, 2023
@jmhooper jmhooper deleted the jmhooper-return-false-expired-for-interval-for-other-auth-method branch October 26, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants