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

Verify acuity webhook #61

Open
olivernyc opened this issue Dec 22, 2020 · 0 comments
Open

Verify acuity webhook #61

olivernyc opened this issue Dec 22, 2020 · 0 comments
Projects

Comments

@olivernyc
Copy link
Contributor

We need to verify acuity message signatures to make sure they are not forged. https://developers.acuityscheduling.com/docs/webhooks

// Get hash of message using shared secret:
var hasher = crypto.createHmac('sha256', secret);
hasher.update(buf.toString());
var hash = hasher.digest('base64');

// Compare hash to Acuity signature:
if (hash !== req.header('X-Acuity-Signature')) {
    throw new Error('This message was forged!');
}
@olivernyc olivernyc created this issue from a note in MVP (To do) Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
MVP
To do
Development

No branches or pull requests

1 participant