JWT authentication for your Symfony REST API
PHP
Clone or download
chalasr feature #537 Customizable User ID Claim (Spomky)
This PR was squashed before being merged into the 2.x-dev branch (closes #537).

Discussion
----------

Customizable User ID Claim

This PR modifies the claim used to store the user ID in tokens.
Prior this PR, the claim was the same as the `user_entity_field` option (e.g. `username`).

Now the user ID claim can be customized to the standard claim `sub` (subject) as per the [RFC7519 section 4.1.2](https://tools.ietf.org/html/rfc7519#section-4.1.2) or any other value (e.g. `user_id`).

A new configuration option s added: `user_id_claim`. If null, it will have the same value as `user_entity_field`.

This PR also allow a BC with tokens that have already been issued by an application.

Commits
-------

0862239 Customizable User ID Claim
Latest commit 5103fff Aug 10, 2018
Permalink
Failed to load latest commit information.
Command Add a `lexik:jwt:generate-token` command Jun 20, 2018
DependencyInjection Customizable User ID Claim Aug 10, 2018
Encoder Customizable User ID Claim Aug 10, 2018
Event Added missing typehint Jan 22, 2018
Exception CS fixes Mar 4, 2018
Resources Customizable User ID Claim Aug 10, 2018
Response PhpDoc @internal is removed Nov 4, 2017
Security Customizable User ID Claim Aug 10, 2018
Services Customizable User ID Claim Aug 10, 2018
Signature [Feature] clock skew May 14, 2018
Tests Customizable User ID Claim Aug 10, 2018
TokenExtractor Make the token type case insensitive Nov 9, 2017
.gitignore cleanup JWTProvider, added and updated tests Jul 12, 2014
.php_cs Fix fixers unconsistency Jun 14, 2016
.scrutinizer.yml Fix requirements Oct 19, 2017
.styleci.yml #179 Add php-cs-fixer/style-ci configuration (chalasr) Jun 7, 2016
.travis.yml Support HMAC based signers from lcobucci/jwt Jun 12, 2018
CHANGELOG.md Customizable User ID Claim Aug 10, 2018
CONTRIBUTING.md Improve the structure of the documentation (#269) Nov 8, 2016
Events.php [Security] Deprecate current system in favor of a JWTTokenAuthenticat… Sep 20, 2016
LICENSE Update license and move it at the root directory Sep 17, 2016
LexikJWTAuthenticationBundle.php Add a `lexik:jwt:generate-token` command Jun 20, 2018
README.md Support HMAC based signers from lcobucci/jwt Jun 12, 2018
UPGRADE-2.0.md Add UPGRADE file for v2.5 Jun 30, 2018
UPGRADE-2.5.md Add UPGRADE file for v2.5 Jun 30, 2018
composer.json Customizable User ID Claim Aug 10, 2018
phpunit.xml.dist Customizable User ID Claim Aug 10, 2018

README.md

LexikJWTAuthenticationBundle

Build Status StyleCI Scrutinizer Code Quality SensioLabsInsight Latest Stable Version

This bundle provides JWT (Json Web Token) authentication for your Symfony API.

It is compatible and tested with PHP 5.5, 5.6, 7.0, 7.1, HHVM on Symfony 3.4 and 4.0.

Documentation

The bulk of the documentation is stored in the Resources/doc directory of this bundle:

Community Support

Please consider opening a question on StackOverflow using the lexikjwtauthbundle tag, it is the official support platform for this bundle.

Github Issues are dedicated to bug reports and feature requests.

Contributing

See the CONTRIBUTING file.

Upgrading from 1.x

Please see the UPGRADE file.

Credits

License

This bundle is under the MIT license.
For the whole copyright, see the LICENSE file distributed with this source code.