You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mode: filter # Or 'reject' for stricter enforcement
47
+
```
48
+
49
+
With this setup, your GraphQL API allows both anonymous and authenticated requests, but authorization directives control which fields each user can access.
50
+
23
51
## The Two Authorization Directives
24
52
25
53
### `@authenticated`
@@ -257,34 +285,6 @@ query {
257
285
}
258
286
```
259
287
260
-
## Integration with JWT Authentication
261
-
262
-
Authorization directives work alongside your [JWT authentication setup](./jwt-authentication.mdx). Here's the flow:
263
-
264
-
1.**Client sends request** with JWT token in the `Authorization` header
265
-
2.**Router validates JWT** using your configured JWKS provider
266
-
3.**Router extracts scopes** from the JWT claims (`scope` field)
267
-
4.**Router checks authorization directives** against the extracted scopes
268
-
5.**Query proceeds or fails** based on authorization result
mode: filter # Or 'reject' for stricter enforcement
284
-
```
285
-
286
-
With this setup, your GraphQL API allows both anonymous and authenticated requests, but authorization directives control which fields each user can access.
0 commit comments