anilkumarthakur60's avatar

it possible to listen to a private channel without authentication? (Vue + Laravel Passport)

I’m working on a Vue.js frontend with a Laravel backend (API only, using Passport for authentication).
I’m setting up real-time events using broadcasting with reverb, and I ran into a question regarding private channels.

Normally, when you use private channels, Laravel expects the client to authenticate using /broadcasting/auth – and that’s working fine when my user is authenticated via Passport tokens.

However, for some parts of the app (like some public widgets), I’d like to listen to private channels without having to authenticate every time.
Basically, I want clients to connect to private channels without hitting the /broadcasting/auth route.

Is it possible to listen to private channels without authentication?
Or what i have to do to achive this:


Thanks for any ideas or advice! 🙏

1 like
7 replies
vincent15000's avatar

No it's not possible.

By default a user needs to be authenticated to access a private channel.

https://laravel.com/docs/12.x/broadcasting#concept-overview

Events are broadcast over "channels", which may be specified as public or private. Any visitor to your application may subscribe to a public channel without any authentication or authorization; however, in order to subscribe to a private channel, a user must be authenticated and authorized to listen on that channel.

1 like
martinbean's avatar

@anilkumarthakur60 How are you intending to listen on a private channel if you don’t authenticate the user and determine whether they have access to that private channel in the first place?

If you don’t want to require authentication to listen on the channel then you don’t want a private channel.

1 like
Bwata's avatar

I have a similar question for my situation. I want to have a "private" space where you just need to have the specific url with a uuid. An authenticated user will create the space but they want to share the space with unauthenticated users. I don't want the other users to have to log in. Thoughts?

martinbean's avatar

I have a similar question for my situation.

@bwata Then post your own question instead of bumping a 10-month old topic?

2 likes
Bwata's avatar

I am sorry, I didn't phrase it right. It is really the same question and I should have responded to your comment asking why someone would want a private channel for an un-authenticated user. I presented my scenario and was hoping to continue the conversation to see if there was a possibility of it happening or another way to "authenticate" a user without a login.

1 like
vincent15000's avatar

This post is very old, the best is that you create your own post.

1 like
Bwata's avatar

Not to quibble with you but 10 months is not very old and in a user forum I would think having less posts that fulfill the questions would be better then multiple posts that ask the same thing and don't get resolved. I still get a lot a value from 10 year old articles or SO posts if the content is still relevant. I would hope for longevity of content that is helpful long term. Sorry for the soap boxing there a second. I am just looking for help and thought to continue this thread instead of making a new one.

Please or to participate in this conversation.