Skip to content

Fixed subscribe JWT claim parameter #11888

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

Merged
merged 1 commit into from
Jul 5, 2019
Merged

Fixed subscribe JWT claim parameter #11888

merged 1 commit into from
Jul 5, 2019

Conversation

dekamaru
Copy link
Contributor

@dekamaru dekamaru commented Jul 4, 2019

If you follow current guide and set claim mercure subscribe with single string - you get following error from mercure: json: cannot unmarshal string into Go struct field mercureClaim.subscribe of type []string

Subscribe parameter is array, not single string.
You can verfiy it by decoding JWT in these official examples:

  1. https://github.com/dunglas/mercure/blob/master/examples/publisher-php.php
  2. https://github.com/dunglas/mercure/blob/master/hub/authorization_test.go

@javiereguiluz
Copy link
Member

Ping @dunglas. Thanks!

@dunglas
Copy link
Member

dunglas commented Jul 4, 2019

@dekamaru good catch! The example is faulty, thanks for fixing it (and thanks @javiereguiluz for the mention).

@javiereguiluz javiereguiluz added this to the 4.2 milestone Jul 5, 2019
If you follow this guide and set claim mercure `subscribe` with single string - you get following error from mercure: `json: cannot unmarshal string into Go struct field mercureClaim.subscribe of type []string`

Subscribe parameter is array, not single string.
You can verfiy this in official example: https://github.com/dunglas/mercure/blob/master/examples/publisher-php.php
Just decode `DEMO_JWT` and see content
@javiereguiluz javiereguiluz changed the base branch from 4.3 to 4.2 July 5, 2019 06:48
@javiereguiluz
Copy link
Member

javiereguiluz commented Jul 5, 2019

@dekamaru good catch! Thanks for fixing it and congrats on your first Symfony Docs contribution!

@javiereguiluz javiereguiluz merged commit c089b6e into symfony:4.2 Jul 5, 2019
javiereguiluz added a commit that referenced this pull request Jul 5, 2019
This PR was submitted for the 4.3 branch but it was merged into the 4.2 branch instead (closes #11888).

Discussion
----------

Fixed subscribe JWT claim parameter

If you follow current guide and set claim mercure `subscribe` with single string - you get following error from mercure: `json: cannot unmarshal string into Go struct field mercureClaim.subscribe of type []string`

Subscribe parameter is array, not single string.
You can verfiy it by decoding JWT in these official examples:
1. https://github.com/dunglas/mercure/blob/master/examples/publisher-php.php
2. https://github.com/dunglas/mercure/blob/master/hub/authorization_test.go

Commits
-------

c089b6e Fixed subscribe claim parameter set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants