-
When I tried to take a sneakpeek on https://jwt.io/ with the encrypted JWT, they gave me a warning like so: Warning: Looks like your JWT payload is not a valid JSON object. JWT payloads must be top level JSON objects as per https://tools.ietf.org/html/rfc7519#section-7.2 This is my code:
And this is my test:
I have tried to put the payload in the key-pair first inside the encode function, also gave me warnings. Is it perhaps due to the payload being encrypted? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
EncryptJWT produces a JWE style JWT, which is, well, actually encrypted and encoded suitable for encrypting your sessions that only you can decrypt wit. jwt.io does not support JWE tokens SignJWT, far more commonly used (and misused) produces a JWS style JWT, which is, well, signed and encoded. You're maybe thinking of signing a jwt, not encrypting it? I don't get the question otherwise. Yes the jwt is encrypted and so obviously its payload cannot be read without decrypting first. |
Beta Was this translation helpful? Give feedback.
EncryptJWT produces a JWE style JWT, which is, well, actually encrypted and encoded suitable for encrypting your sessions that only you can decrypt wit. jwt.io does not support JWE tokens
SignJWT, far more commonly used (and misused) produces a JWS style JWT, which is, well, signed and encoded.
You're maybe thinking of signing a jwt, not encrypting it? I don't get the question otherwise. Yes the jwt is encrypted and so obviously its payload cannot be read without decrypting first.