Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth session cannot be prolonged even if the user is active #1690

Closed
jimmytheneutrino opened this issue Jan 13, 2020 · 7 comments · May be fixed by piotrkpc/hydra#15
Closed

Auth session cannot be prolonged even if the user is active #1690

jimmytheneutrino opened this issue Jan 13, 2020 · 7 comments · May be fixed by piotrkpc/hydra#15
Labels
feat New feature or request. stale Feedback from one or more authors is required to proceed.
Milestone

Comments

@jimmytheneutrino
Copy link

Describe the bug

The fix for #1557 changed the logic of when the session is killed. The hard timeout makes it now impossible to prolong the session even if the user is active and keeps refreshing tokens via silent refresh.

Could we reintroduce the possibility for the old behavior while keeping the new behaviour possible, too? In particular, it would be enough if setting rememberFor to a positive value on skipped login would still trigger the recreation of the session cookie.
See the relevant line: https://github.com/ory/hydra/pull/1564/files#diff-daf069930bf5aee3faa0136e399ebaa2R433

This way, omitting the rememberFor on skipped login would result in the current behaviour (the old cookie is kept, max-age is not changed). But providing positive rememberFor would update the cookie with the new max-age, thus prolonging its life.

@aeneasr
Copy link
Member

aeneasr commented Jan 13, 2020

I think it would be better to set RememberFor to something large the first time the user authenticates that you can live with, such as a month, 6 months, or a year. It's typically a good idea to purge the cookie at some point. Wouldn't that too resolve your issue?

@jimmytheneutrino
Copy link
Author

Not exactly. I want the session to die after a period of inactivity of, say, 4-6 hours. But not to die when the user is active. If I could reset rememberFor on skipped request, this could be easily achieved.

@aeneasr
Copy link
Member

aeneasr commented Jan 14, 2020

Right, that makes total sense!

The reason we disabled this behavior was because people might accidentally set RememberFor to some value always but do actually intend to not refresh the session every time.

Therefore, I think we should add another payload, something along the lines of RefreshRememberTTL uint64 (or bool) which would have the effect you want. Still trying to figure out if it should be the number of seconds as well, or if it should be a boolean which basically re-enables the RememberFor flag. Not sure at the moment about the naming, appreciate ideas!

@jimmytheneutrino
Copy link
Author

I think, a more-or-less standard name for such a behavior is session timeout (e.g., server.servlet.session.timeout in spring boot). This could, in theory, be different from the total max-age of the session set by rememberFor.

@aeneasr aeneasr added this to the v1.3.0 milestone Jan 15, 2020
@aeneasr aeneasr added the feat New feature or request. label Jan 15, 2020
@aeneasr
Copy link
Member

aeneasr commented Jan 15, 2020

Ok, tracking this - contributions are welcomed

@aeneasr aeneasr modified the milestones: v1.4.0, v1.5.0 Apr 23, 2020
@aeneasr aeneasr modified the milestones: v1.5.0, v1.6.0 Jul 1, 2020
@aeneasr aeneasr modified the milestones: v1.6.0, v1.8.0 Aug 4, 2020
@jeremiahsmall
Copy link

Is this going to be addressed soon?

@github-actions
Copy link

github-actions bot commented Mar 5, 2023

Hello contributors!

I am marking this issue as stale as it has not received any engagement from the community or maintainers for a year. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas on how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan for resolving the issue.

Throughout its lifetime, Ory has received over 10.000 issues and PRs. To sustain that growth, we need to prioritize and focus on issues that are important to the community. A good indication of importance, and thus priority, is activity on a topic.

Unfortunately, burnout has become a topic of concern amongst open-source projects.

It can lead to severe personal and health issues as well as opening catastrophic attack vectors.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone.

If this issue was marked as stale erroneously you can exempt it by adding the backlog label, assigning someone, or setting a milestone for it.

Thank you for your understanding and to anyone who participated in the conversation! And as written above, please do participate in the conversation if this topic is important to you!

Thank you 🙏✌️

@github-actions github-actions bot added the stale Feedback from one or more authors is required to proceed. label Mar 5, 2023
harnash pushed a commit to Wikia/ory-hydra that referenced this issue Apr 12, 2023
It is now possible to extend session lifespans when accepting login challenges.

Closes ory#1690
Closes ory#1557
Closes ory#2246
Closes ory#2848

Co-authored-by: Mart Aarma <mart.aarma@nortal.com>
Co-authored-by: Henning Perl <henning.perl@gmail.com>
Co-authored-by: ory-bot <60093411+ory-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request. stale Feedback from one or more authors is required to proceed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants