Repository navigation
Deprecate legacy cookie behaviour behind LEGACY_COOKIES profile
#26161
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
Changes from all commits
832434f
d056d4b
fa37517
43c46c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,3 +1,27 @@ | ||||||
| = Deprecation of 'legacy' cookie behavior | ||||||
|
|
||||||
| As part of the https://privacysandbox.com/[Privacy Sandbox] effort, Keycloak is making changes to the way cookies are handled. Specifically we are preparing for the https://developers.google.com/privacy-sandbox/blog/cookie-countdown-2023oct[end of third-party cookies], and are looking to improve the consistency, privacy and security of how cookies are handled by default within Keycloak. This has several implications for how Keycloak is configured and used: | ||||||
|
|
||||||
| == Removal of cookies suffixed in `_LEGACY` | ||||||
|
|
||||||
| Since the introduction of the https://web.dev/articles/samesite-cookies-explained[`SameSite`] attribute on cookies provided by Keycloak, another set of 'legacy' cookies (name suffixed in `_LEGACY`) were also introduced in order to support older browsers that were https://www.chromium.org/updates/same-site/incompatible-clients/[not compatible] with this attribute. Since the `SameSite` attribute is now https://caniuse.com/same-site-cookie-attribute[widely supported], this behavior is now deprecated, so that only the cookies using the `SameSite` attribute remain. | ||||||
|
|
||||||
| == `SameSite` attribute set to `Strict` by default | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this title accurate or it is more about our future plans? We don't necessarily need to force
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The documentation updates here reflect what I intend the implementation to be under this PR (yet to be implemented).
It would still be 'overwritable' in code for specific use-cases, but not globally configurable if that is what you mean here. Is there a link to these previous discussions somewhere that can be referenced? Future changes in Chrome will move all these to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah, but only if we don't set the attribute, right? My point is that I'm not sure if we should do the I'll need to go over the closed/open issues to filter discussions ...
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
To my knowledge also if we don't set the attribute, it will eventually not be possible to share cookies in a third-party context.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can NOT use Basically if the We can consider
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really for applications running within the same domain, right? We have open issues about making it possible to configure our cookies and use |
||||||
|
|
||||||
| All cookies provided by Keycloak will now have the `SameSite` attribute set to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#strict[`Strict`] by default. This means that cookies will only be sent in a first-party context, that is, requests originating from the same site that set the cookie. Some specific cookies that are required in a third party contexts, such as the session cookie are exempt from this behavior for now, but this will likely change in the future as using cookies in a third-party context will no longer supported by browsers. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
It looks the word
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above - strict also has implications on cookies not being available after redirects/links to Keycloak |
||||||
|
|
||||||
| == Support for insecure contexts dropped | ||||||
|
|
||||||
| Due to the aforementioned changes, we are officially dropping support for running Keycloak outside of a https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts[secure context]. You should therefore ensure that your Keycloak instance if always running on what is https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#when_is_a_context_considered_secure[considered a secure context]. As part of this, all cookies set by Keycloak will have the https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#secure[`Secure`] attribute by default. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mean that some more update might need to be done in the documentation in relation to this? I can think of some update for the option
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, the documentation will have to be reviewed and modified in this regard. Once the implementation settles down that will be the next step. |
||||||
|
|
||||||
| You can restore this behavior by enabling the `legacy-cookies` feature. For example: | ||||||
|
|
||||||
| ``` | ||||||
| kc.[sh|bat] start --features legacy-cookies | ||||||
| ``` | ||||||
|
|
||||||
| This is however considered a temporary workaround, and will be removed in a future release. You should make sure to migrate your Keycloak instance to a secure context as soon as possible. | ||||||
|
|
||||||
| = New Welcome Page | ||||||
|
|
||||||
| The 'welcome' page that is shown when a user starts Keycloak for the first time, has been redesigned to provide a better setup experience and has been upgraded to the latest version of https://www.patternfly.org/[PatternFly]. The page layout has been simplified and now includes only a form to register the administrative user. After completing the registration, the user is redirected directly to the Administration Console. | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.