How to use jwks for auth0 jwt validation in Cloudflare workers

I am trying “jwt”-validation in Cloudflare workers.
This “jwt” is made by auth0.

My validation code as follow:

const jwt = require('jsonwebtoken');
const jwksRsa = require('jwks-rsa');
const util = require('util');

const jwksClient = jwksRsa({
  cache: true,
  rateLimit: true,
  jwksRequestsPerMinute: 5,
  jwksUri: `*****`

const jwt_header = JSON.parse(new Buffer.from(id_token.split('.')[0], 'base64').toString());
const getSigningKey = util.promisify(jwksClient.getSigningKey);
const key = await getSigningKey(jwt_header.kid);

However, this code doesn’t work. (I am using wrangler dev for a test.)
The error which I got is
Uncaught (in promise)
TypeError: (t.adapter || s.adapter) is not a function
at t.exports (worker.js:12:357600)
Uncaught (in response)
TypeError: (t.adapter || s.adapter) is not a function

How can I fix it?

Hi, you probably want to take a look at . Hope that helps.

Lib for Auth0 JWT validation with Cloudflare Workers:

Please don’t revive old threads, if people do this constantly we would have hundreds of revived threads which would make it a mess to see the latest posts…

Let’s assume that people know how to sort the latest replies, if not, they would probably ask anyway.