JWT_COOKIE_SAMESITE = 'None' not being respected
See original GitHub issueHi! I have installed version 0.3.1 as my pipenv update --outdated show: django-graphql-jwt: 0.3.1 installed, 0.3.1 required (Unpinned in Pipfile), 0.3.1 available.
And recently with the new change on Chrome policy regarding the cookies I saw that we needed to secure cookies when setting samesite none. More here
However, although I explicitly set this setting accordingly:
GRAPHQL_JWT = {
'JWT_ALLOW_ARGUMENT': False,
'JWT_HIDE_TOKEN_FIELDS': True,
'JWT_VERIFY_EXPIRATION': True,
'JWT_LONG_RUNNING_REFRESH_TOKEN': True,
'JWT_EXPIRATION_DELTA': timedelta(minutes=15),
'JWT_REFRESH_EXPIRATION_DELTA': timedelta(days=7),
'JWT_COOKIE_SECURE': config('JWT_COOKIE_SECURE', cast=bool, default=True),
'JWT_COOKIE_SAMESITE': 'None',
'JWT_CSRF_ROTATION': True,
}
The cookie is being delivered secure but the SAMESITE property is delivered as Lax. I saw the PR #214, actually I had the latest version by that moment and I reinstall, check everything becuase of this new policy, and while Django settings regarding CSRF are working (on chrome I’m receiveng correct props), this one doesn’t
My Django settings that are working:
CSRF_COOKIE_SAMESITE = 'None'
CSRF_COOKIE_SECURE = config(
'CSRF_COOKIE_SECURE', default=True, cast=bool)
SESSION_COOKIE_SAMESITE = 'None'
SESSION_COOKIE_SECURE = config(
'SESSION_COOKIE_SECURE', default=True, cast=bool)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Why won't cross site cookies be sent even with https, samesite ...
It based off of dotnet-labs/JwtAuthDemo. No matter how hard I try, I cannot seem to get the cookie to be set in the...
Read more >An Overview On SameSite Cookie Options In Dotnet Core ...
The following are the cookie SameSite options: Strict; Lax; None; Unspecified. Strict: The 'Strict' mode cookies are only attached to the ...
Read more >SameSite cookies - HTTP - MDN Web Docs
Cookies from the same domain are no longer considered to be from the same site if sent using a different scheme ( http:...
Read more >Enabling SameSite Cookie Rules - ForgeRock Backstage
Cookies received from different sites cannot be accessed, unless the request is using a top-level request, and uses a "safe" HTTP method, such...
Read more >SameSite Cookie Attribute Changes - Auth0
httpOnly, Allows a cookie to be sent only with HTTP requests; not readable ... Cookies with SameSite=none must be secured; otherwise they cannot...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s really confusing that this feature is already part of the documentation but not implemented. @mongkok should I make a PR with a comment in the documentation? I guess that would be really helpful.
For me, the repo currently contains breaking changes. Therefore I forked the repo, rolled back to the code used for version 0.31 and just added the two lines (see here).
Feel free to use this modified version (just paste this into your requirements):
git+git://github.com/open-decision/django-graphql-jwt@mod#egg=django-graphql-jwt
👍 Yeah. Would really appreciate this feature being released.