Skip to content

Utils::validateHmac() throws an Array to string conversion error #403

@maxrice

Description

@maxrice

Issue summary

When using Utils::validateHmac() to validate the HMAC provided by Shopify for an embedded app, any URLs that contain an associative array trigger an "array to string conversion" error on line 91. This method was refactored in #269 and associative array handling wasn't implemented.

Expected behavior

While it would be nice if this library handled associative arrays properly, I'd be fine implementing them in our project if it was documented anywhere how Shopify handles them. I've tried many, many different variations of encoding an associative array into a URL, but have not been able to get the HMAC to match. It's somewhat common to have URLs like ?filter[status]=live and it would be nice to use them with an embedded app and still be able to verify the HMAC.

Steps to reproduce the problem

  1. Pass an associative array to Utils::validateHmac() to reproduce the 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