-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat: option to update session cookie expiry time on session refresh #2848
Conversation
829dace
to
219d381
Compare
Codecov Report
@@ Coverage Diff @@
## master #2848 +/- ##
==========================================
+ Coverage 76.74% 76.81% +0.07%
==========================================
Files 123 123
Lines 9022 9071 +49
==========================================
+ Hits 6924 6968 +44
- Misses 1657 1660 +3
- Partials 441 443 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
219d381
to
a3899d7
Compare
c26c329
to
a59aa69
Compare
737f3b8
to
2e15430
Compare
03cd8ce
to
b50aba5
Compare
d9a22b2
to
657981b
Compare
657981b
to
a584f09
Compare
c708b57
to
0d931c4
Compare
70a1117
to
8f1b39c
Compare
7a0b09a
to
0c146ea
Compare
@@ -265,6 +265,10 @@ type HandledLoginRequest struct { | |||
// authorization will be remembered for the duration of the browser session (using a session cookie). | |||
RememberFor int `json:"remember_for"` | |||
|
|||
// RefreshRememberFor, if set to true, session cookie expiry time will be updated when session is | |||
// refreshed (login skip=true). | |||
RefreshRememberFor bool `json:"refresh_remember_for"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be consistent with the existing values, it is better to name this property refresh_remember
since it is a boolean value.
Existing props are following this format:
remember
- booleanremember_for
- number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, maybe even clearer extend_session_lifespan
. Could also be a time value alternatively (although it would be conflicting with remember_for
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on vacation and will come back to this in few weeks! :)
0c146ea
to
c8f5009
Compare
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>
This pull request introduces feature to update session cookie expiry time on session refresh request.
Use case: We want to keep session duration quite short (15 minutes) and force client applications to periodically extend the session by performing authentication requests with
prompt=none
. Each subsequent authentication request produces a new identity token with lifetime of 15 minutes. But as a security measure we want that browser session cookie would not be kept alive any longer than necessary - therefore browser session cookie duration should be periodically extended, each time by 15 minutes (the same lifetime as each new identity token).Current situation: Browser session cookie (
oauth2_authentication_session
) expiration is set from first acceptLoginRequest'sremember_for
value.When performing subsequent session update requests (authentication requests with
prompt=none
), then browser session cookie expiration cannot be changed.Proposed solution: Add
refresh_remember_for
parameter for PUT /oauth2/auth/requests/login/accept request body. Whenrefresh_remember_for=true
, session cookie expiry will be reset.Related issue(s)
#1690
#1557
#2246
Checklist
introduces a new feature.
contributing code guidelines.
vulnerability. If this pull request addresses a security. vulnerability, I
confirm that I got green light (please contact
security@ory.sh) from the maintainers to push
the changes.
works.
Further Comments
Tests and documentation will be commited after inital acceptance of the proposed feature.