Skip to content

Verifying callback requests in Rails? #16

@andyadams

Description

@andyadams

Hey team,

I'm trying to verify a Phaxio request in a Rails controller, and I can't quite figure out what I need to be feeding into the Phaxio.valid_callback_signature? method's 3rd argument. I've tried inserting the params method directly, building my own hash, and pretty much every combination I can think of.

For a regular 'received' fax, what format of data should I be providing for the validation method?

FWIW, here's roughly the code I've been using:

file = params[:filename]

if Phaxio.valid_callback_signature?(request.env['HTTP_X_PHAXIO_SIGNATURE'], request.url, params, { name: file.headers['name'], tempfile: file.tempfile } )
# Always returns false, no matter what I put into the 3rd (and 4th) argument

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions