Port V13 backoffice cookie validation to V14 #15886
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.
Prerequisites
Description
Right now, the cookie validation for V14 is lacking a lot of basic stuff. For starters, if a user has authenticated against one database, the user authentication survives swapping out the entire DB with another DB (or delete and recreate the DB), as long as the user exist by the same email in both databases 🤦
This PR ports over all (almost all) the current cookie validation from V13 to V14, to handle these silly things.
A few things have been explicitly omitted, because they seems to have little meaning in the Management API. Please consider if this is as meaningful as I think 😆
BackOfficeCookieManager
.IsRemainingSecondsRequest
.BackOfficeSessionIdValidator
and the correspondingEnsureValidSessionId
Notice that this PR brings back the V13 backoffice cookie name (default
UMB_UCONTEXT
, configurable in security settings) - it has up until now been hardcoded to the nameUmbracoBackOffice
in V14.Testing this PR
Swagger
Backoffice
/umbraco/login
. Verify that you are indeed asked to sign in again.