Open beardedfoo opened 1 year ago
The below code fills in all the payload parameters needed, and allows for entry of various keypairs and algorithms to create the jwt. There is a separate parser file used to input the public key, private key and algorithm.
https://gist.github.com/Paul-kuria/9b08ad0b9d0f3b76b8b2e46548ab03ba
The API used by this project has a new authentication scheme (token_v2: https://nuts-node.readthedocs.io/en/stable/pages/integrating/api-authentication.html) which requires JWT bearer tokens to be passed in the "Authentication" header of HTTP requests.
The HTTP requests sent by this application shoud support optionally sending the correct authentication headers as generated from a configurable private key source.
There are a number of libraries available for generating these tokens (https://jwt.io/libraries).