I am trying add verify jwt token method in google cloud function but its showing error

Hi All,

I am trying create Node.js function in GCP (without express just normal http function as shown below)

const jwksRsa = require(‘jwks-rsa’);
const jwt = require(‘express-jwt’);

const checkJwt = jwt({
provided by the JWKS endpoint.
secret: jwksRsa.expressJwtSecret({
cache: true,
rateLimit: true,
jwksRequestsPerMinute: 5,
jwksUri: added
}),

// Validate the audience and the issuer.
audience: ‘addedi’,
issuer: added,
algorithms: added
});

exports.sampleFunctionAuth = (req, res, checkJwt) => {
res.send(“Hello”);
};

how to call checkJwt function ?
any code snippet if possible ?

It’s not working in gcp function . Can any one help me with this .

Thanks and Regards,
Tapas

Hi @tapaselectrical059,

Welcome to the Auth0 Community Forum!

Take a look at our quickstart for a node API:

Hope this helps!

Thanks,
Dan

Thanks for the reply @dan.woda, But we are not using Express.

We are just creating two independent functions. as show above example.

Is there any docs which i can refer to implement Oauth0 to GCP functions without express?

Regards,
Vishal

This doc explains how to validate a jwt:

This node library should help:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.