-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Backoffice Login: Move access/refresh tokens to secure cookies (V17) #20820
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
Conversation
* feat: adds the `credentials: include` header to all manual requests * feat: adds `credentials: include` as a configurable option to xhr requests (and sets it by default to true) * feat: configures the auto-generated fetch client from hey-api to include credentials by default * Add OpenIddict handler to hide tokens from the back-office client * Make back-office token redaction optional (default false) * Clear back-office token cookies on logout * Add configuration for backoffice cookie settings * Make cookies forcefully secure + move cookie handler enabling to the BackOfficeTokenCookieSettings * Use the "__Host-" prefix for cookie names * docs: adds documentation on cookie settings * build: sets up launch profile for vscode with new cookie recommended settings * docs: adds extra note around SameSite settings * docs: adds extra note around SameSite settings * Respect sites that do not use HTTPS * Explicitly invalidate potentially valid, old refresh tokens that should no longer be used * Removed obsolete const --------- Co-authored-by: Jacob Overgaard <[email protected]>
iOvergaard
left a comment
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.
Tested the same things as in the linked Pull Request.
✅ In addition, I verified that the cookies are now enabled by default and cannot be turned off.
✅ The VSCode launch profile works, setting the cookie to SameSite=None through an environment variable
✅ Updated the READMEs to remove the mention of the now-removed "Enabled" setting
AndyButland
left a comment
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.
Works as expected in my tests too.
|
There are failures on acceptance tests though - in the trace can see the error of: And console log of: |
Prerequisites
Description
This is the V17 equivalent of #20779 for V16 - see that PR for details.
...with the obvious exception that
Umbraco:CMS:Security:BackOfficeTokenCookie:Enabledhas been removed. Starting from V17, tokens will always be redacted and passed between the backoffice client and the server in secure cookies.Testing this PR
See #20779