Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presence channel not return wrong auth string. #14

Closed
jinxuanw-clairvoyant opened this issue Apr 30, 2016 · 11 comments
Closed

Presence channel not return wrong auth string. #14

jinxuanw-clairvoyant opened this issue Apr 30, 2016 · 11 comments

Comments

@jinxuanw-clairvoyant
Copy link

I'm trying to build a presence channel. But the auth string returned is not correct.

Here is the back 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 guess the the error is caused by the additional ':' added before the auth string. Here is my string output:

{auth: ":8dacf362f8fe62bae42c33dfe5511d3d1c42144685d5843a6a6a8014490ed0f6",…}

@vinkla
Copy link
Contributor

vinkla commented Jul 7, 2016

Totally forgot about this. Did you manage to solve it?

@vinkla vinkla closed this as completed Jul 24, 2016
@vinkla
Copy link
Contributor

vinkla commented Jul 24, 2016

Closing due to inactivity.

@saleemepoch
Copy link

I am having the exact same issue. Was there any solution to this?

@jinxuan
Copy link

jinxuan commented Oct 24, 2017

Hi, I can't remember exactly since it has been too long. But be sure to check all your input parameters by log it out..

@matudelatower
Copy link

same problem that @jinxuanw-clairvoyant

@kn100
Copy link
Contributor

kn100 commented Jan 3, 2018

Hey, I'll look into this tomorrow afternoon. Please provide me with as much detail as possible in the meantime! Specifically, which version of the library you're using, how you're creating the authentication endpoint, etc.

Reopening due to the issue still being relevant.

@kn100 kn100 reopened this Jan 3, 2018
@saleemepoch
Copy link

Forgot to report back but in my case I believe I had the debugbar package enabled which was throwing a lot of its own code too. Once I disabled debugbar it worked fine. The colon in auth string wasn't an issue.

@kn100
Copy link
Contributor

kn100 commented Jan 4, 2018

Can anyone else confirm that they're having this same issue for the same reason as @saleemepoch lists?

@kn100
Copy link
Contributor

kn100 commented Jan 17, 2018

Closing due to inactivity

@kn100 kn100 closed this as completed Jan 17, 2018
@cliffireri
Copy link

Any solution to this?

@pravnyadv
Copy link

According to pusher(https://pusher.com/docs/channels/library_auth_reference/auth-signatures#worked-example)

The auth response should be a JSON string with an auth property with a value composed of the application key and the authentication signature separated by a colon ':' as follows: {"auth":"278d425bdf160c739803:58df8b0c36d6982b82c3ecf6b4662e34fe8c25bba48f5369f135bf843651c3a4"}

if the auth key starts with just colon that probably means the pusher object was created without providing proper api keys. (i forgot to add the API keys to my environment file and i had the same issue and after providing the keys it worked)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants