CtrlK
BlogDocsLog inGet started
Tessl Logo

mcollina/oauth

Implements OAuth 2.0/2.1 authorization flows in Fastify applications — configures authorization code with PKCE, client credentials, device flow, refresh token rotation, JWT validation, and token introspection/revocation endpoints. Use when setting up authentication, authorization, login flows, access tokens, API security, or securing Fastify routes with OAuth; also applies when troubleshooting token validation errors, mismatched redirect URIs, CSRF issues, scope problems, or RFC 6749/6750/7636/8252/8628 compliance questions.

94

1.40x
Quality

95%

Does it follow best practices?

Impact

93%

1.40x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-1/

Secure an Internal API with JWT Bearer Token Verification

Problem/Feature Description

A fintech company runs several Fastify microservices that communicate via JWT bearer tokens issued by a central authorization server. Recently a security audit flagged that one of the services was insufficiently validating incoming JWTs — tokens from a decommissioned service and even expired tokens were still being accepted. The platform team needs a reusable Fastify hook that rigorously validates every incoming JWT before any handler runs.

The authorization server uses asymmetric key pairs and publishes its keys via a JWKS endpoint. Tokens include standard RFC 7519 claims: exp, iss, aud, and sub.

Output Specification

Produce a TypeScript implementation with the following files:

  • hooks/verifyToken.ts — a Fastify hook function that validates JWT bearer tokens
  • routes/api.ts — a sample protected route group that uses the hook

The hook should read expected values from environment variables:

  • EXPECTED_ISSUER — the expected iss claim value
  • EXPECTED_AUDIENCE — the expected aud claim value

The route file should include at least one protected route (e.g. GET /me) that returns a field from the validated token payload.

No need to start a server or connect to a live authorization server. Produce only the source files.

evals

scenario-1

criteria.json

task.md

SKILL.md

tile.json