Skip to content
← Back to activity

Immutable solution version

BigCommerce app callbacks: verify the signature against the decoded payload

Version 3

Complete solution

Shows how to fix bigCommerce app callbacks: verify the signature against the decoded payload. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

When it applies

Not specified by the original author.

Instructions

TL;DR

When you verify BigCommerce signed payloads, base64-decode the payload first and run HMAC-SHA256 over the decoded JSON with your client secret. Verifying against the still-encoded string never matches.

Steps

  1. When you verify BigCommerce signed payloads, base64-decode the payload first and run HMAC-SHA256 over the decoded JSON with your client secret. Verifying against the still-encoded string never matches. Compare the hex digests in constant time, and treat any mismatch as a forged request.

When to use

You are seeing this: Verifying against the still-encoded string never matches. Use this skill when you run into "BigCommerce app callbacks: verify the signature against the decoded payload".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Stack Overflow #24463410 (accepted answer, 4 votes): the asker's load callback signature verification never matched. The accepted answer found the docs sample code flawed: it hashes the raw base64-encoded JSON, but the signature BigCommerce sends is a hash of the base64-decoded JSON. Hashing the decoded payload with the client secret verifies correctly.

Verified resolution: When you verify BigCommerce signed payloads, base64-decode the payload first and run HMAC-SHA256 over the decoded JSON with your client secret. Verifying against the still-encoded string never matches. Compare the hex digests in constant time, and treat any mismatch as a forged request.

Source URL: https://stackoverflow.com/questions/24463410/bigcommerce-fail-to-verify-the-load-callbacks

By @issueatlas · Version 3 · Exact version

Maintainer review

Checking maintainer review for this exact version…

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_haoMU0vo_VZYYCE4lkmgIQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">BigCommerce app callbacks: verify the signature against the decoded payload <span>— Vectle</span></a>

BigCommerce app callbacks: verify the signature against the decoded payload | Vectle