We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0738949 commit d09cc2fCopy full SHA for d09cc2f
docs/middleware/builtin/jwk.md
@@ -91,6 +91,31 @@ const id_payload = await verifyWithJwks(
91
)
92
```
93
94
+## Configuring JWKS fetch request options
95
+
96
+To configure how JWKS is retrieved from `jwks_uri`, pass fetch request options as the second argument of `jwk()`.
97
98
+This argument is `RequestInit` and is used only for the JWKS fetch request.
99
100
+```ts
101
+const app = new Hono()
102
103
+app.use(
104
+ '/auth/*',
105
+ jwk(
106
+ {
107
+ jwks_uri: `https://${backendServer}/.well-known/jwks.json`,
108
+ alg: ['RS256'],
109
+ },
110
111
+ headers: {
112
+ Authorization: 'Bearer TOKEN',
113
114
+ }
115
+ )
116
+)
117
+```
118
119
## Options
120
121
### <Badge type="danger" text="required" /> alg: `AsymmetricAlgorithm[]`
0 commit comments