Skip to content

Commit

Permalink
docs(gateway): lookupLocations -> tokenLookupLocations
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Nov 19, 2024
1 parent c5ee723 commit dbf2f93
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const signingKey = 'my-secret-key'
export const gatewayConfig = defineConfig({
jwt: {
// Look and extract for the token in the 'authorization' header, with the 'Bearer' prefix.
lookupLocations: [extractFromHeader({ name: 'authorization', prefix: 'Bearer' })],
tokenLookupLocations: [extractFromHeader({ name: 'authorization', prefix: 'Bearer' })],
// Decode and validate the token using the provided signing key.
singingKeyProviders: [createInlineSigningKeyProvider(signingKey)],
// Forward the verified token payload to the upstream GraphQL subgraphs.
Expand Down Expand Up @@ -78,7 +78,7 @@ export const gatewayConfig = defineConfig({
]
// Configure where to look for the JWT token: in the headers, or cookies.
// By default, the plugin will look for the token in the 'authorization' header only.
lookupLocations: [
tokentokenLookupLocations: [
extractFromHeader({ name: 'authorization', prefix: 'Bearer' }),
extractFromCookie({ name: 'auth' }),
],
Expand Down Expand Up @@ -372,7 +372,7 @@ export const gatewayConfig = defineConfig({
// ...
jwt: {
// ...
lookupLocations: [extractFromHeader({ name: 'x-auth-token', prefix: 'Bearer' })]
tokenLookupLocations: [extractFromHeader({ name: 'x-auth-token', prefix: 'Bearer' })]
}
})
```
Expand All @@ -393,7 +393,7 @@ export const gatewayConfig = defineConfig({
// ...
jwt: {
// ...
lookupLocations: [extractFromCookie({ name: 'my-cookie' })]
tokenLookupLocations: [extractFromCookie({ name: 'my-cookie' })]
}
// Make sure you enabled cookie parsing in the gateway
cookies: true,
Expand All @@ -419,7 +419,7 @@ export const gatewayConfig = defineConfig({
// ...
jwt: {
// ...
lookupLocations: [getToken]
tokenLookupLocations: [getToken]
}
})
```
Expand All @@ -440,7 +440,7 @@ export const gatewayConfig = defineConfig({
// ...
jwt: {
// ...
lookupLocations: [
tokenLookupLocations: [
extractFromHeader({ name: 'authorization', prefix: 'Bearer' }),
extractFromHeader({ name: 'x-legacy-auth' }),
extractFromHeader({ name: 'x-api-key', prefix: 'API-Access' }),
Expand Down

0 comments on commit dbf2f93

Please sign in to comment.