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
This PR addresses issue #187 by dynamically using the
config.session.cookie.sameSite
cookie attribute on theauth_verification
cookie ONLY when the response mode is notform_post
.Prior to this, any response mode other than form_post would set the auth_verification cookie (which contains state, nonce and PKCE values) with the
None
SameSite attribute, and would otherwise default toLax
.The main use case is for non-
form_post
response type flows, where the RP would like the auth cookie to have aSameSite
value ofNone
orStrict
, rather than the forced default ofLax
.Docs on the Setting
The language (see docs) around the
SameSite
field states:It seems the docs above actually meant to mention
response_mode
, if that's the case, we should address that here as well.From that language, I belive the intended behavior was that:
appSession
cookie will always use the configured sameSite valueauth_verification
cookie will:SameSite=None
forform_post
response types, ignoring configPotential Security Concern
Up to this point, devs may be relying on the default of
Lax
for response modes other thanform_post
. TBD: What are the security considerations for changing that default behavior, given that:config.session.cookie.sameSite
is alsoLax
appSession
cookie.References
Testing
I added tests to cover what I believe is the expected behavior (see above).
login.tests.js
file (see last two tests)form_post
response modes ignore config and useNone
Checklist
response_type
is mentioned, but should it beresponse_mode
?).master