Why am I receiving "Invalid signature" when subscribing to a private or presence channel?

The invalid signature response means that the signature supplied when subscribing to the private or presence channel does not match the expected signature.

This can occur for one of the following reasons:

The credentials used in the signature are incorrect

The first thing to check is that the app_id, app_key and app_secret are correctly set in the code that's used as part of the authentication.

  1. Are the values set at all?
  2. Are they set correctly? A frequent mistake is to use the app_secret where the app_key is expected and vice versa

 

The socket_id and channel_name values are not being used

The authentication process requires the a socket_id and channel_name to be supplied. If either of these values are not correctly supplied then the generated signature will not match the signature the Pusher generates.

A presence channel is being authenticated without the channel_data

Presence channels allow additional user information to be stored for a user. This data must be included when the signature is generated.

More information

For more information see the authentication process section in the Pusher documentation.

Was this article helpful?
0 out of 0 found this helpful
Haven't found what you were looking for?
Submit a ticket