This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
What middleware for Django's session authentication for graphene-django? #1153
Labels
You can continue the conversation there. Go to discussion →
First off, thanks for graphene-django!
Question: how does graphene-django work with Django's session authentication?
For a number of reasons I need to move away from JWT authentication (which was working fine). I implemented a login mutation as follows.
I see that a fresh
sessionid
is returned. I also see that subsequent calls to graphql includesessionid
in theCookie
HTTP header. So far so good. However, subsequent queries and mutations fail to setinfo.context.user
.I presumably need to set some
MIDDLEWARE
onGRAPHENE
to ensure thatrequest.user
is set based on thesessionid
for incoming requests. But what is that middleware?In other words, what is the equivalent of
graphql_jwt.middleware.JSONWebTokenMiddleware
for Django's session authentication?I see some previous discussions that come close (for example, #476). However, none seem to answer this question directly.
Some other relevant settings:
The text was updated successfully, but these errors were encountered: