Open IliasVilux opened 6 months ago
I use django with graphene and django-auth-ldap. When i run a query or mutation that has @login_required with https headers token i get this:
{ "errors": [ { "message": "User is disabled", "locations": [ { "line": 2, "column": 2 } ], "path": [ "colaboradores" ] } ], "data": { "colaboradores": null } }
MIDDLEWARE = [ ... "django.contrib.auth.middleware.AuthenticationMiddleware", ... ] GRAPHENE = { "SCHEMA": "core.schema.schema", "MIDDLEWARE": [ "graphql_jwt.middleware.JSONWebTokenMiddleware", ], } AUTHENTICATION_BACKENDS = [ "graphql_jwt.backends.JSONWebTokenBackend", "django_auth_ldap.backend.LDAPBackend", "django.contrib.auth.backends.ModelBackend", ]
class Mutation( mutationColaboradores, mutationEstaciones, mutationEstacionesColaboradores, graphene.Mutation, ): token_auth = graphql_jwt.ObtainJSONWebToken.Field() verify_token = graphql_jwt.Verify.Field() refresh_token = graphql_jwt.Refresh.Field() def mutate(self): return ""
class Query(graphene.ObjectType): colaboradores = graphene.List(ColaboradorType) @login_required def resolve_colaboradores(self, info): return Colaborador.objects.all()
I use django with graphene and django-auth-ldap. When i run a query or mutation that has @login_required with https headers token i get this:
settings.py
schema.py
schemaColaborador.py