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

Add OAuth Login to a Fastify Web App

Problem/Feature Description

A development team is building a customer portal using Fastify and TypeScript. The portal needs to allow users to log in via an external identity provider (such as Auth0 or Okta). The team lead has decided to use the industry-standard authorization code flow, which the identity provider supports. The auth server is already configured and running; its base URL is available as an environment variable AUTH_SERVER.

The team needs a complete OAuth plugin for Fastify that handles the login redirect, the callback endpoint, and session storage for the received tokens. They want a clean, maintainable plugin structure that fits naturally into a Fastify codebase with multiple plugins.

Output Specification

Produce a TypeScript implementation in the current directory with the following files:

  • package.json listing all required dependencies
  • plugins/oauth.ts — the OAuth plugin registration
  • routes/auth.ts — login callback and logout routes

Read the following environment variables from process.env:

  • CLIENT_ID, CLIENT_SECRET — OAuth app credentials
  • AUTH_SERVER — base URL of the authorization server
  • CALLBACK_URI — the callback URL registered with the identity provider

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

evals

SKILL.md

tile.json