I downloaded django app which has regular django api. App is really big and I decided to implement django graphene module and to make more flexible api. I have a graphene view which allow sending requests and receiving responses. My problem is that I want to add authentication on graphene view, so every user needs to provide token or username and password to be able to fetch the records.
I found some solution here: Adding LoginRequiredMixin in new view
My problem is I can't login into django app using curl to execute some grapql query.
What I tried so far:
curl -u admin:password123 -X GET http://localhost:8003/graphql?query=query%7B%20types%20%7B%20edges%20%7B%20node%20%7B%20name%20%7D%20%7D%20%7D%20%7D
using jwt_auth
curl -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwidXNlcl9pZCI6MSwiZW1haWwiOiIiLCJleHAiOjE0OTg3NDA4OTR9.FvofAxyhvjTGNZBUUSRF1kmXfgTNja6U52NynLhBGeo" http://localhost:8003/graphql?query=query%7B%20types%20%7B%20edges%20%7B%20node%20%7B%20name%20%7D%20%7D%20%7D%20%7
default app way to login on existing api to my graphene view
curl -H "Authorization: Token 2867936fff9d738ee5fc8a807c86a96e59ab648d" http://localhost:8003/graphql?query=query%7B%20types%20%7B%20edges%20%7B%20node%20%7B%20name%20%7D%20%7D%20%7D%20%7D