Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
Claude Skills Maintainers avatar

Cloudflare Zero Trust Access

  • 196 repo stars
  • Updated July 25, 2026
  • secondsky/claude-skills

Add Cloudflare Zero Trust Access authentication to Workers — JWT validation, service tokens, and CORS for edge-deployed apps.

About

A skill for implementing Cloudflare Zero Trust Access authentication on Workers. Developers use it for JWT validation, service tokens, and CORS, and to resolve preflight blocking, cache race conditions, and missing-JWT-header errors at the edge.

  • Cloudflare Zero Trust Access
  • JWT validation
  • Service tokens
  • CORS & preflight handling

Cloudflare Zero Trust Access by the numbers

  • Data as of Jul 28, 2026 (Skillselion catalog sync)
/plugin marketplace add secondsky/claude-skills
/plugin install cloudflare-zero-trust-access@claude-skills

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
repo stars196
Last updatedJuly 25, 2026
Repositorysecondsky/claude-skills

What it does

Add Cloudflare Zero Trust Access authentication to Workers — JWT validation, service tokens, and CORS for edge-deployed apps.

README.md

cloudflare-zero-trust-access

Cloudflare Zero Trust Access authentication integration for Cloudflare Workers


Quick Reference

  • Package: @hono/cloudflare-access@0.3.1 (recommended)
  • Framework: Hono
  • Platform: Cloudflare Workers
  • Token Savings: ~58% (3,250 tokens)
  • Time Savings: ~2.5 hours per implementation
  • Errors Prevented: 8 documented issues

What This Skill Does

Provides complete integration patterns for Cloudflare Zero Trust Access authentication in Workers applications:

  • ✅ Hono middleware setup (one-line integration)
  • ✅ Manual JWT validation (Web Crypto API)
  • ✅ Service token authentication (machine-to-machine)
  • ✅ CORS + Access integration (correct middleware ordering)
  • ✅ Multi-tenant patterns (organization-level auth)
  • ✅ Error prevention (8 common issues with solutions)
  • ✅ TypeScript type definitions
  • ✅ Helper scripts for testing

Auto-Trigger Keywords

This skill automatically triggers when working with:

Primary Keywords

  • cloudflare access
  • cloudflare zero trust
  • cloudflare one
  • access authentication
  • zero trust authentication
  • access jwt
  • cf-access-jwt-assertion

Technology Keywords

  • @hono/cloudflare-access
  • hono access middleware
  • access middleware
  • jwt validation workers
  • cloudflare auth
  • workers authentication

Use Case Keywords

  • protect worker routes
  • secure worker api
  • admin authentication
  • api authentication
  • service token auth
  • service to service auth
  • backend authentication
  • machine to machine auth

Integration Keywords

  • cors with access
  • cors preflight access
  • spa access authentication
  • access + hono
  • workers access integration
  • multi-tenant access

Error Keywords

  • access jwt validation
  • missing jwt header
  • cors preflight blocked
  • invalid issuer access
  • access token expired
  • service token not working
  • cf-access-client-id
  • cf-access-client-secret

Configuration Keywords

  • access policy setup
  • access application
  • access team domain
  • application audience
  • access aud tag
  • identity provider access

Templates Included

  1. hono-basic-setup.ts - Standard Hono + Access integration
  2. jwt-validation-manual.ts - Manual JWT verification (~100 lines)
  3. service-token-auth.ts - Service token patterns (client + server)
  4. cors-access.ts - CORS + Access (correct middleware ordering)
  5. multi-tenant.ts - Multi-tenant with D1 tenant config
  6. wrangler.jsonc - Complete configuration example
  7. .env.example - Environment variables template
  8. types.ts - TypeScript definitions and type guards

Reference Documentation

  1. common-errors.md - 8 documented errors with solutions (~800 words)
  2. jwt-payload-structure.md - JWT claims reference (~1,200 words)
  3. service-tokens-guide.md - Service token setup guide (~1,100 words)
  4. access-policy-setup.md - Dashboard configuration (~1,400 words)

Helper Scripts

  1. test-access-jwt.sh - JWT testing and debugging tool
  2. create-service-token.sh - Interactive service token setup guide

Common Errors Prevented

Error Time Saved Prevention
CORS preflight blocked 45 min CORS middleware before Access
Missing JWT header 30 min Access URL, not direct Worker URL
Invalid team name 15 min Use environment variables
Key cache race 20 min Use @hono/cloudflare-access
Service token headers 10 min Correct header names
Token expiration 10 min Handle gracefully
Multiple policies 30 min Plan hierarchy
Dev/prod mismatch 15 min Environment configs

Total: ~2.5 hours saved per implementation


Quick Start

# Install
npm install hono @hono/cloudflare-access

# Configure wrangler.jsonc
{
  "vars": {
    "ACCESS_TEAM_DOMAIN": "your-team.cloudflareaccess.com",
    "ACCESS_AUD": "your-aud-tag"
  }
}

# Worker code
import { Hono } from 'hono'
import { cloudflareAccess } from '@hono/cloudflare-access'

const app = new Hono<{ Bindings: Env }>()

app.use('/admin/*', cloudflareAccess({
  domain: (c) => c.env.ACCESS_TEAM_DOMAIN
}))

app.get('/admin/dashboard', (c) => {
  const { email } = c.get('accessPayload')
  return c.json({ email })
})

export default app

When to Use

Use this skill when:

  • ✅ Building Cloudflare Workers with authentication
  • ✅ Protecting admin dashboards or APIs
  • ✅ Implementing service-to-service auth
  • ✅ Integrating SPA with authenticated backend
  • ✅ Multi-tenant applications
  • ✅ Role-based access control (RBAC)

Don't use for:

  • ❌ Cloudflare Pages (different plugin)
  • ❌ Non-Cloudflare platforms
  • ❌ Auth.js or other auth libraries

Integration Patterns

1. Hono Middleware (Recommended)

One-line setup with automatic validation and key caching.

2. Manual JWT Validation

Full control using Web Crypto API for custom logic.

3. Service Token Authentication

Machine-to-machine auth for backends, CI/CD, cron jobs.

4. CORS + Access

Correct middleware ordering for SPAs calling protected APIs.

5. Multi-Tenant

Different Access configurations per tenant/organization.


Package Information

  • @hono/cloudflare-access: 0.3.1 (actively maintained)
  • hono: 4.10.3 (stable)
  • @cloudflare/workers-types: 4.20251014.0 (current)

Last Verified: 2025-10-28


Resources

Documentation:

Packages:

Dashboard:


License

MIT


Skill Version: 1.0.0 Production Tested: ✅ Errors Prevented: 8 Token Savings: 58% Time Savings: 2.5 hours

Related skills

Securityappsecsecrets

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.