sso-core/README.md

22 lines
851 B
Markdown

# sso-core
This is a SvelteKit-powered authentication service.
## Requirements
1. A MySQL or MariaDB database.
2. Node.js 20+ or Docker.
## Set up
1. Clone the repository.
2. Install dependenices - `npm install`.
3. Configure the environment - `cp .env.example .env`.
4. Generate secrets and stuff:
1. Session secret - `node -e 'console.log(require("crypto").randomBytes(16).toString("hex"))'`.
2. Challenge secret - `node -e 'console.log(require("crypto").randomBytes(32).toString("hex"))'`.
3. Generate JWT keys in the `private` directory - `openssl genpkey -out jwt.private.pem -algorithm RSA -pkeyopt rsa_keygen_bits:2048`.
4. Also make the public key - `openssl rsa -in jwt.private.pem -pubout -outform PEM -out jwt.public.pem`.
5. Build the application - `npm run build`.
6. Run the application - `node -r dotenv/config build`.