Skip to content
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

Add SameSite attribute to the OAuth2 state cookie #112

Merged
merged 1 commit into from
Jan 7, 2023
Merged

Conversation

dghubble
Copy link
Owner

  • Add SameSite to the CookieConfig to allow configuring the SameSite attribute on the temporary state cookie used by OAuth2
  • Set strict mode on the DefaultCookieConfig
  • Set none mode on the DebugOnlyCookieConfig

@dghubble dghubble force-pushed the same-site branch 3 times, most recently from ead1be7 to c0ad713 Compare January 7, 2023 22:22
* Add a SameSite field to the CookieConfig to allow configuring the
SameSite attribute on the temporary state cookie used by OAuth2
* Set lax mode on the DefaultCookieConfig and DebugOnlyCookieConfig
* Generally, we can't use SameSite strict for the OAuth2 temporary
state cookie. Strict cookies are not sent in the requests to the
callback handler because the redirect chain originated with a redirect
to another domain (e.g. github, google), which is considered the
referrer. Instead, lax mode must be used
* Increase the temporary cookie max age from 1m to 10m to allow users
longer to complete the authorization flow (e.g. login to a provider,
maybe complete 2FA, review permissions, grant permission)

Rel:

* https://www.nogginbox.co.uk/blog/strict-cookies-not-sent-by-request
* https://bugzilla.mozilla.org/show_bug.cgi?id=1453814
@dghubble dghubble merged commit b718922 into main Jan 7, 2023
@dghubble dghubble deleted the same-site branch January 7, 2023 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant