eXist-db library to create and read JSON Web Tokens with arbitrary payloads.
Can be used to authorise requests with restxq and controller.xql.
As long as you keep your secret you can trust the information in valid tokens.
exist-JWT is implemented as an XQuery module and packaged as an eXist-db xar package which will be installed alongside your app.
Install the XAR and
import module namespace jwt="http://existsolutions.com/ns/jwt";
For more details look at examples and tests.
- eXist-db version 5.0.0+
- eXist-db crypto lib 1.0.0+
Prequisites:
- node 10+
- a running exist-db at localhost:8080
Clone this repository and
- Install dev dependencies
npm install
- Build and install the XAR package in your exist-db instance
npm start
- Run the testsuite
npm test
Prequisites:
- a running exist-db with jwt installed
Evaluate test/runner.xq
This interaction diagram shows how a token is created and used to access a restricted resource.