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-5/

Build a Secure Internal Token Issuance Service

Problem/Feature Description

A platform team is building a lightweight OAuth authorization server component in Fastify that will issue short-lived access tokens to internal microservices using the client credentials flow. The service will expose a /token endpoint that microservices can call to obtain JWTs for service-to-service communication.

During a threat model review, the security team flagged two concerns: the token endpoint must be protected from brute-force and credential-stuffing attacks, and all communication must use TLS — the service should refuse to issue tokens if the request came in over plain HTTP. The service will only be deployed behind an HTTPS load balancer, but the code itself should enforce these constraints.

Output Specification

Produce a TypeScript Fastify application with the following files:

  • package.json — listing all required dependencies
  • plugins/oauth.ts — OAuth client credentials plugin setup
  • routes/token.ts — the /token endpoint implementation
  • middleware/security.ts — any rate limiting or HTTPS enforcement logic

Read server credentials from environment variables: CLIENT_ID, CLIENT_SECRET, AUTH_SERVER.

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

evals

SKILL.md

tile.json