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

JWT support in this bundle? #69

Open
duanegran opened this issue Sep 5, 2018 · 2 comments
Open

JWT support in this bundle? #69

duanegran opened this issue Sep 5, 2018 · 2 comments

Comments

@duanegran
Copy link

In the OAuth2 server that this based on it appears to support JWT tokens (http://bshaffer.github.io/oauth2-server-php-docs/overview/jwt-access-tokens/) but I don't see how to utilize this with the Symfony bundle. Is there some way in the tokenAction() for the TokenController to do this?

@vroad
Copy link

vroad commented Sep 10, 2018

@duanegran Seems possible by adding this to config.yml:

parameters:
  oauth2.server.config:
    use_jwt_access_tokens: true
    issuer: https://www.acme.com
  oauth2.storage.public_key.class: Acme\AuthBundle\Storage\PublicKey

This bundle lacks command and storage for storing public/private key, so you need to create them by yourself.
Authorization code storage is not used with this config. Probably because generated JWT token contains all information you need. (You can extract information from JWT by decoding with the public key)

@vroad
Copy link

vroad commented Sep 10, 2018

You also need to change the implementation of token storage if you use JWT. Without that, the server tries to store generated token to the DB and causes problems, because JWT is not a random string and violates unique constraints of token column.

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

2 participants