From 075ffa6e3ff04a9a0dac6ce8f31bb54d564171df Mon Sep 17 00:00:00 2001 From: landrigun Date: Wed, 12 Oct 2022 15:43:19 +0000 Subject: [PATCH] feat: #11 update README --- README.md | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b43427c..a0c26d7 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,48 @@ A little web server providing JWT token for auth auser. -**NOTE**: for now, the server is listening on port **9000**. Change it, in the src if needed. - ## Build - ```bash cargo build --release +``` -# run the server -./target/release/simple-auth +## Configuration + +### Store +The store represents the credentials. For now, this a `.txt` file with plain passwords. You have to create one like: +```txt +# acts as a comment (only on a start line) +: +``` +**WARN**: the file should have a chmod to **600**. + +### RSA key pair creation +The server uses **RS384** signature algorithm (asymmetric). You have to create a private key to sign the token and a public key for the validation: +```bash +openssl genrsa -out priv.pem 2048 +openssl rsa -in priv.pem -outform PEM -pubout -out pub.pem +``` +**WARN**: those files must be readable be the server user + +### INI file +To start the server correctly, you need to create an `.ini` file as below: +```ini +[server] +url = : + +[store] +path = + +[jwt] +issuer = +private_key = +public_key = +expiration_time = 2 # in hours +``` + +## Run +```bash +./simple-auth ``` ## Test