Skip to content

Issue with hash generation  #4

@tkline615

Description

@tkline615

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions