cloudflare-zero-trust-access

Implement Cloudflare Zero Trust Access authentication for Cloudflare Workers.

204|30|Updated Nov 8, 2025
One-click install
npx skills add https://github.com/secondsky/claude-skills --skill cloudflare-zero-trust-access-secondsky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-zero-trust-access
Source: https://github.com/secondsky/claude-skills/tree/main/plugins/cloudflare-zero-trust-access/skills/cloudflare-zero-trust-access
Command: npx skills add https://github.com/secondsky/claude-skills --skill cloudflare-zero-trust-access-secondsky

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Integrates Cloudflare Zero Trust Access authentication with Cloudflare Workers, enabling application-level authentication and fine-grained access control.

Core Features & Use Cases

  • Hono Middleware pattern for automatic JWT validation
  • Manual JWT validation templates
  • Service tokens for machine-to-machine auth
  • CORS + Access integration patterns
  • Multi-tenant and RBAC patterns (advanced)

Quick Start

Follow the quick start to configure Access team domain, AUD, and begin protecting routes with the recommended templates.

Frequently Asked Questions about cloudflare-zero-trust-access

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement JWT validation for Cloudflare Workers with Zero Trust Access?

JWT validation with Cloudflare Zero Trust Access involves configuring your ACCESS_TEAM_DOMAIN and ACCESS_AUD environment variables, then using either Hono middleware for automatic validation or manual JWT verification templates. The Skill provides integration patterns for both approaches, enabling you to authenticate requests and enforce access control at the application level.

Can I use Cloudflare Zero Trust Access with CORS in my application?

Yes. Zero Trust Access integrates with CORS by applying careful header ordering—CORS headers must be set before Access preflight requests are blocked. The Skill includes CORS-first patterns that demonstrate correct ordering and preflight handling to prevent authentication conflicts with cross-origin requests.

How do I authenticate machine-to-machine requests using Cloudflare Access service tokens?

Service tokens enable machine-to-machine authentication by allowing applications and services to authenticate directly to your Workers without user interaction. The Skill provides service token authentication templates that show how to configure and validate service tokens for automated, inter-service communication.

What's the difference between Hono middleware and manual JWT validation for Access authentication?

Hono middleware automatically validates JWT tokens and handles authentication transparently within your route handlers, reducing boilerplate. Manual JWT validation gives you explicit control over token verification logic and custom claim inspection. The Skill includes templates for both, letting you choose based on your complexity and control needs.

Does Cloudflare Zero Trust Access support multi-tenant and role-based access control patterns?

Yes. The Skill includes advanced multi-tenant and RBAC patterns that leverage JWT claims and custom routing logic to isolate tenant data and enforce role-based permissions. These patterns enable fine-grained access control across multiple tenants within a single Cloudflare Worker deployment.

What environment configuration is required before integrating Zero Trust Access with my Workers?

You must configure ACCESS_TEAM_DOMAIN (your Cloudflare Access team domain) and ACCESS_AUD (the application's audience identifier) as environment variables. The Skill's quick start guides you through this setup, which is required for JWT validation and token verification to function correctly.