integreat-authenticator-jwt
v1.1.5
Published
JWT authenticator for Integreat
Downloads
1,471
Readme
JWT authenticator for Integreat
Signs a JWT token.
Getting started
Prerequisits
Requires node v18 and Integreat v1.0.
Installing and using
Install from npm:
npm install integreat-authenticator-jwt
The authenticator supports the following options:
key
: The key to sign the JWT with. Requiredalgorithm
: The algorithm to sign with. DefaultHS256
subPath
: A dot notation path into the request object, to get the JWT sub claimaudience
: The JWT audience claim. RequiredexpiresIn
: The expiration time for the JWT, as a ms string. When not set, the token will never expirepayload
: An object whose properties will be set on the JWT payloadtrustedKeys
: A JavaScript Map of trusted keys used for validating JWTs on incoming actions. This is only relevant for thevalidate()
method, and it is also the only option relevant for this method.
Running the tests
The tests can be run with npm test
.
Contributing
Please read CONTRIBUTING for details on our code of conduct, and the process for submitting pull requests.
License
This project is licensed under the ISC License - see the LICENSE file for details.