Allow configuring OIDC state cookie age #40316
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #40268.
The situation in #40268 was confirmed to be resolved, but I'd like to close it with a somewhat related hardening improvement - if the state cookies are lost for some reasons, at least their age is controlled and is not set for the reasons I don't recall now to 30 mins which is a way too long for state cookies and the browser will clear these cookies much faster.
It will also let users manage the expectations how long an authorization code flow can run. For example, if the user has been redirected to authenticate to the OIDC provider and the state cookie is set to 3 mins but the user is returned back in 20 mins (why ?) then the browser will lose the state cookie and the authentication will have to be restarted.
Also updated the OIDC code flow doc, changed the TOC along the way a bit to make some sections more visible.