Replies: 2 comments
-
Hi @naphtul
Then it is not an Unsecured JWT, in which case, it's not intended to be decoded by this particular API. In v3.x i intentionally left out the affordance to decode arbitrary signed token for a number of reasons
import { decode } from 'jose/util/base64url'
const textDecoder = new TextDecoder()
JSON.parse(textDecoder.decode(decode(jwt.split('.')[1]))) Putting the above aside.
Now this is protocol/application specific, but each of those token types has their uses and you arguably know upfront which one is expected in a particular context, context is what gives you the means to verify without needing to look into its contents first. |
Beta Was this translation helpful? Give feedback.
-
Thank you! |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am trying to implement version 3.0.2.
This line:
jose/src/jwt/unsecured.ts
Line 86 in 2276f5a
is creating a chicken and egg situation for me, as my token has a signature.
I used to decode the secured token first, get its type (id or access) and then verify it accordingly (with id token I would also verify the audience).
Maybe my approach was wrong to begin with.
Your advice is appreciated.
Thank you!
Naphtali
Beta Was this translation helpful? Give feedback.
All reactions