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
wrangler
andnvm
installed. - Run
nvm install
to install the correct Nodejs version. - Run
sh generate-ecdsa-keypair.sh
. This will create an.env
file and addPUBLIC_KEY
andPRIVATE_KEY
to it. - Run
npm run dev
.
- Make sure you have
wrangler
andnvm
installed. - Run
nvm install
to install the correct Nodejs version. - Go to the Workers dashboard, create a new project called
sso
. - Go to the Workers KV dashboard, make sure
USER
namespace is created. - Run
wrangler secret put PUBLIC_KEY
and type in your public key. - Run
wrangler secret put PRIVATE_KEY
and type in your private key. - Run
wrangler publish
.