Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Signatures not match. #69

Open
thoaif opened this issue Feb 20, 2021 · 0 comments
Open

Error: Signatures not match. #69

thoaif opened this issue Feb 20, 2021 · 0 comments

Comments

@thoaif
Copy link

thoaif commented Feb 20, 2021

Hi,

I am trying to set up the webhook for SMS status report, and I have tried the example setup in the docs. I am able to receive a GET request tunneled through ngrok, but I keep encountering "Error: Signatures not match."

Here is stack trace:

Error: Signatures not match.
    at validate (/home/user/messagebird-example/node_modules/messagebird/lib/signature.js:124:11)
    at signatureMiddleware (/home/user/messagebird-example/node_modules/messagebird/lib/signature.js:143:7)
    at Layer.handle [as handle_request] (/home/user/messagebird-example/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/user/messagebird-example/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/user/messagebird-example/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/user/messagebird-example/node_modules/express/lib/router/layer.js:95:5)
    at /home/user/messagebird-example/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/home/user/messagebird-example/node_modules/express/lib/router/index.js:335:12)
    at next (/home/user/messagebird-example/node_modules/express/lib/router/index.js:275:10)
    at rawParser (/home/user/messagebird-example/node_modules/body-parser/lib/types/raw.js:67:7)

and here is the minimal server code I am using:

const express = require('express')

const app = express()

const Signature = require('messagebird/lib/signature')

const verifySignature = new Signature(process.env.SIGNING_KEY)

app.use(require('body-parser').raw({ type: '*/*' }))

app.get('/webhook', verifySignature, function (req, res) {
  res.send('Verified')
})

const port = process.env.PORT || 3000
app.listen(port, () => {
  console.log(`Running at http://localhost:${port}`)
})

I have spent hours trying to debug this issue, including regenerating signing keys, using different routes, etc. Could you please help? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant