Is it possible to use this library in postman pre-request script ? #276
Unanswered
anujkumar1012
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You can use a CDN like E.g. using a dynamic import const [
{ jwtVerify },
{ createRemoteJWKSet }
] = await Promise.all([
import('https://cdn.jsdelivr.net/gh/panva/[email protected]/dist/browser/jwt/verify.js'),
import('https://cdn.jsdelivr.net/gh/panva/[email protected]/dist/browser/jwks/remote.js')
])
const token = 'eyJraWQiOiJNRlplRzEwMmRRaXFiQU5vYU1sV19KbWY3Zk9abXRSc0h0NzdKRmhUcEYwIiwiYWxnIjoiRVMyNTYifQ.eyJmb28iOiJiYXIiLCJpYXQiOjE2MzM0MzU4MDF9.aYumnM7eTWpwIit6WGxFg8bYR3giAdZGzbbPi_4bUnS-HDjk01D50GQXI_A7Bu1pVrw3ELucwmV_vaQ4_v_EUQ'
const JWKS = createRemoteJWKSet(new URL('https://op.panva.cz/jwks'))
const { payload, protectedHeader } = await jwtVerify(token, JWKS)
console.log({ protectedHeader, payload }) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to use this library in postman pre-request script ? Postman requires, CDN equivalent of the library to load it in an environment variable.
Beta Was this translation helpful? Give feedback.
All reactions