Skip to content

Conversation

@kjac
Copy link
Contributor

@kjac kjac commented Nov 13, 2025

Prerequisites

  • I have added steps to test this contribution in the description below

Description

This is the V17 equivalent of #20779 for V16 - see that PR for details.

...with the obvious exception that Umbraco:CMS:Security:BackOfficeTokenCookie:Enabled has 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

kjac and others added 3 commits November 13, 2025 08:50
* 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]>
Copy link
Contributor

@iOvergaard iOvergaard left a 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

Copy link
Contributor

@AndyButland AndyButland left a 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.

@AndyButland
Copy link
Contributor

There are failures on acceptance tests though - in the trace can see the error of:

@
ApiHelpers.ts:343
TypeError: Cannot read properties of undefined (reading 'toString')

And console log of:

Error refreshing access token.
Login failed

@kjac kjac merged commit ba7d550 into release/17.0 Nov 14, 2025
23 of 24 checks passed
@kjac kjac deleted the v17/feature/auth-cookies branch November 14, 2025 16:10
@iOvergaard iOvergaard changed the title Move access/refresh tokens to secure cookies (V17) Backoffice Login: Move access/refresh tokens to secure cookies (V17) Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants