[Django]-Django Azure AD Integration

2👍

I know this question is a bit old, but the session won’t be able to be retrieved (and with it the original state and nonce), and will fail the comparison if the cookie is not being sent by the browser.

The cookie is not sent by default in django 2.1+, since the default settings add SameSite=Lax

The cookies used for django.contrib.sessions, django.contrib.messages,
and Django’s CSRF protection now set the SameSite flag to Lax by
default. Browsers that respect this flag won’t send these cookies on
cross-origin requests. If you rely on the old behavior, set the
SESSION_COOKIE_SAMESITE and/or CSRF_COOKIE_SAMESITE setting to None.

https://docs.djangoproject.com/en/3.0/releases/2.1/#samesite-cookies

In theory this should still send the cookie (from what I understand), but for some reason chrome doesn’t seem to. There’s something I clearly do not understand, so if anyone knows better please comment.

Anyway, changing the setting via SESSION_COOKIE_SAMESITE = None should work.

Leave a comment