JsonWebTokenError: invalid signature


I downloaded and successfully ran the quick start integration . . . for a while. I added some console.log lines and the token stop working. I removed those lines, change the signing secret, nothing works.

This is the displayed error:
[nodemon] 2.0.7
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .env src/**/*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node ./src/app.js
listening at localhost:8302 || tunnel: https://monday-integration-100000055.loca.lt
JsonWebTokenError: invalid signature
at /media/luisgabrielmendezbarreiro/LGMBData/Developments/NodeJS/quickstart-integrations/node_modules/jsonwebtoken/verify.js:133:19
at getSecret (/media/luisgabrielmendezbarreiro/LGMBData/Developments/NodeJS/quickstart-integrations/node_modules/jsonwebtoken/verify.js:90:14)
at Object.module.exports [as verify] (/media/luisgabrielmendezbarreiro/LGMBData/Developments/NodeJS/quickstart-integrations/node_modules/jsonwebtoken/verify.js:94:10)
at authenticationMiddleware (/media/luisgabrielmendezbarreiro/LGMBData/Developments/NodeJS/quickstart-integrations/src/middlewares/authentication.js:9:67)
at Layer.handle [as handle_request] (/media/luisgabrielmendezbarreiro/LGMBData/Developments/NodeJS/quickstart-integrations/node_modules/express/lib/router/layer.js:95:5)
at next (/media/luisgabrielmendezbarreiro/LGMBData/Developments/NodeJS/quickstart-integrations/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/media/luisgabrielmendezbarreiro/LGMBData/Developments/NodeJS/quickstart-integrations/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/media/luisgabrielmendezbarreiro/LGMBData/Developments/NodeJS/quickstart-integrations/node_modules/express/lib/router/layer.js:95:5)
at /media/luisgabrielmendezbarreiro/LGMBData/Developments/NodeJS/quickstart-integrations/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/media/luisgabrielmendezbarreiro/LGMBData/Developments/NodeJS/quickstart-integrations/node_modules/express/lib/router/index.js:335:12)

I’m in the last part of the developers certification.

Please help.


Hi @lgmendez, welcome to our community!

Hmm, I’m assuming you verified that you’re using the correct Signing Secret for that app? Did you run npm install and npm run start in that order?

It’s difficult to say why this issue may be popping up for you to be honest. It might even be a good idea to start from scratch.

Let me know what you’ve tried and we can see where to go from there.

Thanks Helen.

Yes and Yes. I did run npm install and then npm run start.

I follow the steps in the quick start documentation. Test the app and it worked. Make some changes to the text returning value in the transformation service, just to check that I have control. Test again and it worked. Then I change the source column value to date and change the transformation formula to process that date => Authentication error. Then I renew the signing secret and past it into env file and run it again. It worked once. I make another change and didn’t work. Renew signing secret and past it, didn’t work.

I know that all the code require for the persistent token is not in the quickstart so I did it and have it in other branch. First I want it to be sure that everything worked in the integration before including the authorization. Solving one problem at a time.

Can I work with the temporary token (and keep renewing it) and make the integration work during the development of the integration functionality? If so, how can I?

Hi @lgmendez,

It sounds like you’re using the shortLivedToken as described in our Integration Authentication article, right?

If this is the case, you can utilize it for your integration recipes without issue. If you take a look at the authentication.js file in the Quickstart Integrations code, you can see how authorization is done.

I’m a bit confused on the issue that you’re running into-- did you chance something about this authorization method? When you say “persistent token,” are you referring to OAuth as stated in the article as well?

In all of the test integration recipes I’ve built, I’ve been able to utilize shortLivedToken without issue.

Hi @Helen,

Right. I didn’t want to loose more time so I restarted everything. Erase the integration, the project and do it all over again. Now it’s working.

Thanks for your responses.

1 Like

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