@neumatter/jwt
v1.0.1
Published
Module for JWTs and JWKs.
Downloads
3
Maintainers
Readme
JWT
Table of Contents
Install
npm i @neumatter/jwt
Usage
Signing:
import { JWS, UnsecuredJWT } from '@neumatter/jwt'
const jwt = new UnsecuredJWT({ expiresIn: 'PT4H', id: '123456789' }, { alg: 'HS256' })
const jws = await JWS.sign(jwt, process.env.SECRET_JWT)
Verifying:
import { JWS } from '@neumatter/jwt'
const jws = new JWS(signedString)
const unsecuredJWT = await jws.verify(process.env.SECRET_JWT)