Skip to content
Discussion options

You must be logged in to vote
// CACHE THIS FOR SUBSEQUENT REQUESTS
const JWKS = jose.createRemoteJWKSet(new URL('https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com'))

const { payload, protectedHeader: header } = await jose.jwtVerify(
    jwt,
    JWKS,
    {
      issuer,
      audience,
    }
  )

console.log({ payload, header })

As for your development tokens, they're Unsecured JWT so you need to use jose.UnsecuredJWT.decode. Just be sure to only use UnsecuredJWT in development environments.

const { payload, header } = jose.UnsecuredJWT.decode(jwt) // ONLY IN DEVELOPMENT ENVIRONMENTS
console.log({ payload, header })

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@ben519
Comment options

@ben519
Comment options

@ben519
Comment options

@panva
Comment options

@ben519
Comment options

Answer selected by ben519
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants