Skip to content

Signed header requests python3 refactoring #27

@jfarcher

Description

@jfarcher

While trying to refactor a script of ours which is based upon the following sample code:
https://github.com/janrain/Janrain-Sample-Code/blob/master/signed-header-requests/signed-request.py

I have updated the hmac.new to ensure the passed data is in the byte format as required, however errors are returned:
code: 431
error: signature_does_not_match
error_description: The request signature we calculated does not match the signature you provided

key=bytes(secret, 'UTF-8')
message=bytes(str_to_sign, 'UTF-8')
hashed_str = b64encode(hmac.new(key, message, sha1).digest())

Please could you advise on the best steps to be taking on upgrading to python 3?

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