JSON WebToken Bundle for Symfony 3
Creating a key:
$ openssl genrsa -out your_private.key 2048Extracting public key
$ openssl rsa -pubout -in your_private.key -out your_public.keyExample config
hygrid_jwt:
issuer: https://yourdomain.com
token_expiry: 60
signing:
public_key: 'file://%kernel.root_dir%/ssh/your_public.key' # only needed for service using tokens.
private_key: 'file://%kernel.root_dir%/ssh/your_private.key' # only needed for service issuing tokens.Usage:
$issuer = $this->get('hygrid_jwt.issuer');
$token = $issuer->getToken(['testing' => 'awesome']);
// Pass token to back in responseToken consumer:
$parser = $this->get('hygrid_jwt.parser');
$token = $parser->parse($token_as_string); // Will throw exception if not valid signature.Configuration is sparse, use at own risk (or fork).
Built using https://github.com/lcobucci/jwt