Skip to content

websocket authentication using python #190

@o5mo-lj

Description

@o5mo-lj

Hi, I've been unable to authenticate using websockets (to access account streams). Is there any example of this being done in python? I'm building the signature as below and I'm receiving the error message "authentication failed. authentications failed. invalid signature" Any advice?

nowInMilisecond = str(int(time.time() * 1000))
path = "/users/self/subscribe"
stringToSign = path + "\n" + nowInMilisecond

update_param__str = stringToSign
update_param_byteencoded = update_param_str.encode()

new_hmac = hmac.new(
secret_byteencoded,
msg=update_param__byteencoded,
digestmod=hashlib.sha512,
)
new_hmac_updated_hexdigested = new_hmac.hexdigest()

return nowInMilisecond, new_hmac_updated_hexdigested

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