Authorization issue when running dgraph locally vs Slash

Report a Dgraph Bug

What version of Dgraph are you using?

20.11.0 and Slash

Have you tried reproducing the issue with the latest release?


What is the hardware spec (RAM, OS)?

docker-compose so the specs are virtual

Steps to reproduce the issue (command/config used to run Dgraph).

I am trying to use JWT for auth but it doesn’t work when running dgraph myself - it works in Slash.

Here’s a simple Todo

type Todo @withSubscription @auth(
    query:  { rule: "{ $email: { eq: \"\" } }"}
    add:    { rule: "{ $email: { eq: \"\" } }"}
    update: { rule: "{ $email: { eq: \"\" } }"}
    delete: { rule: "{ $email: { eq: \"\" } }"}
) {
    id: ID!
    value: String!
    completed: Boolean! @search
# Dgraph.Authorization {"VerificationKey":"-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----","Header":"X-Auth-Token","Namespace":"jhk324jk","Algo":"RS256"}

Expected behaviour and actual result.

If I try to query or add data without the @auth, it works, when I add it back it doesnt. With @auth it only works on slash, but as soon as i change the url back to my docker onein apollo-client, it stops working again, unless if I remove @auth.