Or more generally, if I may, can I request some love given to JWT stdlib swi offers? All I can find is this with almost no doc and the directory above it gives me Forbidden access denial.
I’m just looking for an encoder and decoder that takes a header, payload, and key and returns a base64 token consistent with the JWT protocol (so preferably eliminates padding, and so forth), and vis versa.
I also did find this but it’s unfortunately quite outdated and I couldn’t get it to work. For example it only supports kty: "oct"
for the keytype and not the more secure EC or RSA, and beyond that, when I ran the token through the JWT debugger it gives me “invalid signature” (this is even the case with the sample token they present in the readme).
Anyway I asked chatgpt and after LOAD of “generate code → run it → get an error → show chatgpt → regenerate code” cycles, still couldn’t get it to work.
The closest I got was this
https://pastebin.com/QDMWKRsx
but the result you get from this is
{"alg":"HS256","typ":"JWT"}.{"sub":"1234567890","name":"John Doe","iat":1516239022}
..o6kgõëgõ÷·5õÝ;kWßv¸m¦¸ÛÝÛÛµï¦üߧáÖ÷ãÝüñÍ×û
true.
which obviously does not look correct. Can I get some assistance with this please?