/Knowledge/sources/honojs__hono/llms-full/jwk-auth-middleware-usage--part-02--bc968d820929.md
JWK Auth Middleware: Usage (part 02) - hono-docs
JWK Auth Middleware: Usage (part 02) Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt usage Summary ts...
JWK Auth Middleware: Usage (part 02)
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#usage
Summary
```ts const app = new Hono() app.use( '/auth/*', jwk({ jwks_uri: (c) => https://${c.env.authServer}/.well-known/jwks.json, alg: ['RS256'], allow_anon: true, }) ) app.get('/auth/page', (c) => { const payload = c.get('jwtPayload') return...
Content
const app = new Hono()
app.use(
'/auth/*',
jwk({
jwks_uri: (c) =>
`https://${c.env.authServer}/.well-known/jwks.json`,
alg: ['RS256'],
allow_anon: true,
})
)
app.get('/auth/page', (c) => {
const payload = c.get('jwtPayload')
return c.json(payload ?? { message: 'hello anon' })
})
Metadata
{
"chunk_index": 1,
"citation": "https://hono.dev/llms-full.txt#usage",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / JWK Auth Middleware > Usage (2)",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 321,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "JWK Auth Middleware: Usage (part 02)",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}