Deploy an OpenAuth server on Cloudflare Workers.
OpenAuth is a universal provider for managing user authentication. By deploying OpenAuth on Cloudflare Workers, you can add scalable authentication to your application. This demo showcases login, user registration, and password reset, with storage and state powered by D1 and KV. Observability is on by default.
[!IMPORTANT] When using C3 to create this project, select "no" when it asks if you want to deploy. You need to follow this project's setup steps before deploying.
Outside of this repo, you can start a new project with this template using C3 (the create-cloudflare CLI):
npm create cloudflare@latest -- --template=cloudflare/templates/openauth-template
A live public deployment of this template is available at https://openauth-template.templates.workers.dev
npm install
npx wrangler d1 create openauth-template-auth-db
...and update the database_id field in wrangler.json with the new database ID.migrations directory in this project):npx wrangler d1 migrations apply --remote openauth-template-auth-db
npx wrangler kv namespace create AUTH_STORAGE
...and update the kv_namespaces -> id field in wrangler.json with the new namespace ID.npx wrangler deploy
npx wrangler tail