Thanks for the quick reply!
Well, I would still need to bundle the admin key with my app, right? I have to use the admin key because the login mutation only exists on the /admin endpoint. That’s what confused me so much. How is this supposed to work and why is the Tenant-0 always exposed to public?
Here’s what I did to get the accessJWT when I query against the graphql endpoint:
type Tokens {
accessJWT: String
refreshJWT: String
}
type LoginPayload {
response: Tokens
}
type Mutation {
getTokenForNamespace(userId: String, password: String, namespace: Int, refreshToken: String): LoginPayload @custom(http: {
url: "https://<endpoint>/admin",
method: POST,
secretHeaders: [
"DG-Auth:AdminKeyTesting"
],
introspectionHeaders:["DG-Auth:AdminKeyTesting"]
graphql: "mutation($userId: String, $password: String, $namespace: Int, $refreshToken: String) { login(userId: $userId, password: $password, namespace: $namespace, refreshToken: $refreshToken) }"
})
}
# Dgraph.Secret AdminKeyTesting "YOUR-ADMIN-KEY-HERE"
Why does it work on the Shared Cluster then?