OAuth Auth Server through Workers
Dec 12, 2018Victoria Bernard

Summary
This post details the implementation of a custom OAuth 2.0 authentication server using Cloudflare Workers and Cloudflare Storage (KV). It outlines the steps involved in the OAuth 2.0 workflow, including user redirection, code generation, and token exchange. The implementation leverages JWT for session management and demonstrates how to handle client secrets and store codes and tokens in KV namespaces. The post also highlights the potential use of Cloudflare Access as an alternative for simpler authentication needs.
More from the Website Security & Threat Management trail
- We tested our own WAF with frontier AI models. Here’s what we found
- When scanners miss the attack: how Cloudflare Client-Side Security protects storefronts
- Introducing automatic remediation policies with Cloudflare CASB
- Introducing context-aware vulnerability discovery and remediation with Cloudflare Managed Defense and OpenAI Daybreak Models
- Introducing Adaptive Intelligence: undermining the economics of every bot attack