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

Issue with hash generation #4

Open
tkline615 opened this issue Jan 9, 2024 · 0 comments
Open

Issue with hash generation #4

tkline615 opened this issue Jan 9, 2024 · 0 comments

Comments

@tkline615
Copy link

Within /src/util/slack.ts I was having problems getting the verifySlackRequest function to match Slack's signature. I'm currently running node v18.17.0 and got it working by adjusting the createHmac function call to include "utf8" as a second argument after the signature base string. My updated and working version is this:

  const hash = createHmac("sha256", secret)
    .update(`v0:${timestamp}:${request.body}`, "utf8")
    .digest("hex");

Wanted to comment to help anyone else out that may experience the same issue.

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