symfony / mercure-bundle

The MercureBundle allows to easily push updates to web browsers and other HTTP clients in the Symfony full-stack framework, using the Mercure protocol.
https://symfony.com/doc/current/mercure.html
MIT License
288 stars 20 forks source link

When private is set to true, mercure returns unathorized #38

Closed ArensMyzyri closed 3 years ago

ArensMyzyri commented 3 years ago

Any idea why mercure returns 401 when publisher field private is set to true? image

With false works just fine.

azjezz commented 3 years ago

Hello @ArensMyzyri

This problem is probably because you didn't see the topic name in your JWT token.

assuming $topic->getTopicName() returns foo, your JWT token content should look something like {"mercure": {"publish": ["foo"]}}

If you wish to be able to publish to all topics, you can set "publish" list to ["*"].

you can read more about mercure authorization here: https://symfony.com/doc/current/mercure.html#authorization

can you please confirm that this is the case?

chalasr commented 3 years ago

Closing due to the lack of feedback.