Laravel Pusher Channel Authentication Error

I am trying to create a presence channel. But the returned auth string is incorrect.

Here is the code end code:

class pusherController extends Controller { protected $pusher; public function __construct(PusherManager $pusher) { $this->pusher = $pusher; } public function pusherPinyinAuth(Request $request) { if($request->user()) { $user = $request->user(); $auth= $this->pusher->presence_auth($request->input('channel_name'),$request->input('socket_id'), $user->id, array('h'=>'user_info')); return response($auth); } } } 

Error message

 Pusher : Error : {"type":"WebSocketError","error":{"type":"PusherError","data":{"code":null,"message":"Auth value for subscription to presence-5 is invalid: should be of format 'key:signature'"}}} 

I assume the error is caused by being added before: ':', added before the auth line. But I manually delete that it still reports the same error. Here is my line output:

 {auth: ":8dacf362f8fe62bae42c33dfe5511d3d1c42144685d5843a6a6a8014490ed0f6",…} 

I use the pusher bridge https://github.com/vinkla/pusher

I want to try the official pusher-php server, but after installing the composer I don’t know how to use it in my code. I want to know if https://github.com/pusher/pusher-http-php has .

+6
source share
1 answer

For me, this was caused by the pusher key, secret and app_id values ​​are not set correctly during production.

+5
source

All Articles