Skip to content

Commit

Permalink
docs: fix auth rhai example and link
Browse files Browse the repository at this point in the history
- In Rhai, it is `request[.subgraph].body.extensions`, the examples were
	missing the `.body`
- Fix link to rhai example for forwarding headers
  • Loading branch information
parkerholladay committed Sep 9, 2023
1 parent b6164b3 commit 9603211
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/source/configuration/authn-jwt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ You enable JWT authentication for your router with the following steps:
router:
jwt:
jwks: # This key is required.
- url: https://dev-zzp5enui.us.auth0.com/.well-known/jwks.json
issuer: <optional name of issuer>
- url: https://dev-zzp5enui.us.auth0.com/.well-known/jwks.json
issuer: <optional name of issuer>

# These keys are optional. Default values are shown.
header_name: Authorization
Expand Down Expand Up @@ -204,7 +204,7 @@ fn process_request(request) {
status: 401
};
}
request.subgraph.extensions["claims"] = claims;
request.subgraph.body.extensions["claims"] = claims;
}
```

Expand Down Expand Up @@ -650,7 +650,7 @@ This matching strategy is necessary because some identity providers (IdPs) don't

## Forwarding JWTs to subgraphs

Because the Apollo Router handles validating incoming JWTs, you rarely need to pass those JWTs to individual subgraphs in their entirety. Instead, you usually want to [pass JWT _claims_ to subgraphs](#example-forwarding-claims-to-subgraphs) to enable fine-grained access control.
Because the Apollo Router handles validating incoming JWTs, you rarely need to pass those JWTs to individual subgraphs in their entirety. Instead, you usually want to [pass JWT _claims_ to subgraphs](#example-forwarding-claims-to-subgraphs-as-headers) to enable fine-grained access control.

If you _do_ need to pass entire JWTs to subgraphs, you can do so via the Apollo Router's general-purpose [HTTP header propagation settings](./header-propagation).

Expand Down

0 comments on commit 9603211

Please sign in to comment.