I’m reading https://dgraph.io/docs/graphql/authorization/authorization-overview/ and have some questions.
I’m using keycloak oidc server, I’m sure you’re familiar with it or with oidc in general.
https://connect.icod.de/auth/realms/testrealm/.well-known/openid-configuration
is the autoconfiguration url, it has jwk url
-
Can this # Dgraph.Authorization be on multiple lines?
-
In audience the returned id token has [“account”, “the-client-id”], is it enough to set [“the-client-id”]?
-
Namespace, I don’t understand this. Do I have to provide an example id token payload there in JSON format?
-
Header, what should the header provide to the endpoint? “The claims relevant to dgraph authorization”.
I’d use https://github.com/gogatekeeper/gatekeeper/blob/master/docs/user-guide.md#upstream-headers
As you can see there are some options which can be passed. Personally I’d check by “sub” if someone has access to a resource.
Right now this is my
# Dgraph.Authorization {"VerificationKey":"","Header":"X-Auth-Subject", "jwkurl":"https://connect.icod.de/auth/realms/testrealm/protocol/openid-connect/certs", "Namespace":"https://xyz.io/jwt/claims","Algo":"RS256","Audience":["devel"]}
Let’s move on to @auth
.
The examples don’t make any sense at all.
Where do I write criteria? How does this all work?
Is there a real life example?
Queries and Mutations are autogenerated, how does this work in detail in context of @auth()