mees- / jwt-service

A very simple JWT microservice that has users and issues/verifies JWTs

Home Page:https://journal.mees.io/jwt-service/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JWT service

This is a simple microservice that can create users, issue jwt tokens and validate them

Getting started in docker

Environment variables

  • CONNECTION_STRING some postgres connection string. Format: postgres://user:password@host:port/database_name
  • SECRET the hmac sh256 signing secret
  • ISSUER the issuer name on the tokens
  • AUDIENCE optional: the audience on the tokens
  • EXPIRY_TIME optional: the time after which a JWT expires. This is parsed with Zeit/ms.
  • PORT optional: in docker this is set to 80 by default
  • ADMIN_USER optional: set this to set the user id for the admin user. Default: admin
  • ADMIN_PASS: optional: set this to set the password for the admin user. If you don't set this then no admin user is created.

Setting ADMIN_PASS essentially only needs to happen once on first run, since the admin user doesn't need to be recreated every time. It is safe to keep it set though. If a user with ADMIN_USER as username already exists, it won't be modified and admin user creation will be skipped.

About

A very simple JWT microservice that has users and issues/verifies JWTs

https://journal.mees.io/jwt-service/


Languages

Language:TypeScript 97.2%Language:Dockerfile 2.8%