JWTIn
Super simple service-to-service authentication mechanism with distributed secrets as environment variables.
Define Services Secrets
You need to provide an environment variable JWTIN
with a JSON encoded map of service:secret
:
JWTIN="{\"s1\":\"aaa\", \"s2\":\"bbb\"}"
Create a Token
const createToken = const token = await
The token's secret will be secret(s1) + secret(s2)
Validate a Token
const validateToken = const token = await // console.log(token.from)// console.log(token.to)// console.log(token.payload)