ctjlewis
(C. Lewis)
May 8, 2021, 11:09pm
13
@aman-bansal , can you please provide an example in the form of a GraphQL rule? I cannot figure out how to use the filter
operation with @auth
ROLE claim.
[v21.03] Consider Auth0 JWT structure where ROLE claim is an array:
{
"https://dgraph.io/jwt/claims": {
"USER": "ctjlewis",
"ROLE": [
"Admin",
...
]
},
...
}
I have tried the following form for the add rule but the request still fails unless I comment it out:
add: {
rule: "{$ROLE: { eq: \"Admin\" } }"
}
Is there a recommended approach for using the @auth directive and array ROLE JWT claim? It doesn’t seem immediately obvious to me if this is possible, and Aut…