stevegraham/slanger — Issue #21: AuthenticationError
Author: wunki
Created: 2012-02-28 19:54:10+00:00
State: open

First, thanks for a great library! I'm trying to connect to the API with the Python client but keep getting an `AuthenticationError`. I have looked at the Python client and the SHA it generates, but couldn't find any errors. The Python SHA is generated from the following string, combined with the secret:

POST\n/apps/invy/channels/1/events\nauth_key=0&auth_timestamp=1330458397&auth_version=1.0&body_md5=a5288e2a55b02d65f0fc66a2731f678f&name=an_event

It's generated at [L54](https://github.com/pusher/pusher_client_python/blob/master/pusher/__init__.py#L54) of the Python client. But I keep getting the this error:

Invalid signature: you should have sent
HmacSHA256Hex("POST\n/apps/invy/channels/1/events\nauth_key=0&auth_timestamp=1330458305&auth_version=1.0&body_md5=a5288e2a55b02d65f0fc66a2731f678f&name=an_event&{\"some\": \"data\"}=", your_secret_key), but you sent "a0b71a6728c01363e3dd51ce6ba57326488d4fe5b2f03cf70b6d517c77b9ca9b"

Only difference I'm seeing is that your SHA creation add's the body of the message to the end of the string. That's not something I see documented in the [REST API](http://pusher.com/docs/rest_api). Is there a mismatch in SHA generation between your API and the Python library?

Thanks in advance.