This is a Serverless SSO service for my web applications. Its powered by Bcryptjs for password hashing, Jose for JWT and Worktop's Router for routing HTTP requests.
Due to the limitation of the worker's 10ms cpu limit, passwords are only hashed up to 5 salt rounds (The recommended is 10). Users info are stored in Workers KV, a globally distributed, eventually consistent key value store.
This costs $0 to maintain, due to Cloudflare's generous workers free teir (100,000 req/day). Noice 😎
- Make sure you have
wranglerandnvminstalled. - Run
nvm installto install the correct Nodejs version. - Run
sh generate-ecdsa-keypair.sh. This will create an.envfile and addPUBLIC_KEYandPRIVATE_KEYto it. - Run
npm run dev.
- Make sure you have
wranglerandnvminstalled. - Run
nvm installto install the correct Nodejs version. - Go to the Workers dashboard, create a new project called
sso. - Go to the Workers KV dashboard, make sure
USERnamespace is created. - Run
wrangler secret put PUBLIC_KEYand type in your public key. - Run
wrangler secret put PRIVATE_KEYand type in your private key. - Run
wrangler publish.