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.
Description
When merged, this PR will add SameSite cookie support for required authentication values. Both the
nonce
(checked against the value in the ID token during callback) andstate
(checked against the value returned from the authorization server during callback) values will move from session storage to cookie storage. This allows a SameSite attribute ofNone
to be added, as well as a Secure flag, when theresponse_type
ofform_post
is used (this is the default configuration).By default, a legacy support cookie with no SameSite attribute and no Secure flag will be set as well (this can be turned off with the
legacySameSiteCookie
attribute passed to theauth()
configuration). This is done to support browsers that do not handle SameSite cookies set toNone
but has the added benefit of allowing insecure local applications to function without SSL/TLS in the interim.Please note: The browser changes unexplained in the Web.dev article below will require all applications (including local ones) using the
response_mode
ofform_post
(default for this library) to be served over HTTPS.Changes to follow
There are a few more changes that need to happen in this library to fully support SameSite. These will come in [a] separate PR[s]:
state
andnonce
values (as introduced here).max_age
(have an internal task tracking that).References
Web.dev: SameSite cookies explained
Testing
Checklist