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

**URL:** <https://community.auth0.com/t/i-am-trying-add-verify-jwt-token-method-in-google-cloud-function-but-its-showing-error/34603>\
**Category:** Get Help\
**Tags:** gcp, auth0\
**Created:** [December 3, 2019, 11:13am UTC](https://community.auth0.com/t/i-am-trying-add-verify-jwt-token-method-in-google-cloud-function-but-its-showing-error/34603 "2019-12-03T11:13:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tapaselectrical059](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tapaselectrical059/32/14506_2.png) [@tapaselectrical059](https://community.auth0.com/u/tapaselectrical059)\
**Post date:** [December 3, 2019, 11:13am UTC](https://community.auth0.com/t/i-am-trying-add-verify-jwt-token-method-in-google-cloud-function-but-its-showing-error/34603/1 "2019-12-03T11:13:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 4, 2019, 1:47am UTC](https://community.auth0.com/t/i-am-trying-add-verify-jwt-token-method-in-google-cloud-function-but-its-showing-error/34603/3 "2019-12-04T01:47:48Z")

</div>

Hi @tapaselectrical059,

Welcome to the Auth0 Community Forum!

Take a look at our quickstart for a node API:

> **[Auth0 Node (Express) API SDK Quickstarts: Authorization](https://auth0.com/docs/quickstart/backend/nodejs/01-authorization#configure-the-middleware)**
>
> This tutorial demonstrates how to add authorization to an Express.js API.

Hope this helps!

Thanks,  
Dan

---

<div class="post-metadata">

**Author:** ![tapaselectrical059](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tapaselectrical059/32/14506_2.png) [@tapaselectrical059](https://community.auth0.com/u/tapaselectrical059)\
**Post date:** [December 4, 2019, 4:49am UTC](https://community.auth0.com/t/i-am-trying-add-verify-jwt-token-method-in-google-cloud-function-but-its-showing-error/34603/4 "2019-12-04T04:49:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 4, 2019, 5:15pm UTC](https://community.auth0.com/t/i-am-trying-add-verify-jwt-token-method-in-google-cloud-function-but-its-showing-error/34603/5 "2019-12-04T17:15:24Z")

</div>

This doc explains how to validate a jwt:

> **[Validate JSON Web Tokens](https://auth0.com/docs/secure/tokens/json-web-tokens/validate-json-web-tokens)**
>
> Describes how to parse and validate a JSON web token (JWT).

This node library should help:

> **[GitHub - auth0/node-jsonwebtoken: JsonWebToken implementation for node.js...](https://github.com/auth0/node-jsonwebtoken)**
>
> JsonWebToken implementation for node.js http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html - GitHub - auth0/node-jsonwebtoken: JsonWebToken implementation for node.js http://self-iss...

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 18, 2019, 9:19pm UTC](https://community.auth0.com/t/i-am-trying-add-verify-jwt-token-method-in-google-cloud-function-but-its-showing-error/34603/6 "2019-12-18T21:19:34Z")

</div>

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