You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using user_identity_field in configuration generates depreacted notification:
The "%path%.%user_identity_field%" configuration key is deprecated since version 2.16, use "%path%.user_id_claim" or implement "' . UserInterface::class . '::getUserIdentifier()" instead.
But using user_id_claim will not behave as we expect when using value other than username, the method JWTManager::addUserIdentityToPayload will always consider values from user_identity_field (as default value which is username).
$payload['id'] = $accessor->getValue($user, $accessor->isReadable($user, 'username') ? 'username' : 'user_identifier');
// which will give `username` if property is readable
Instead it should first consider $this->userIdClaim field first and then try to access field using $this->userIdentityField.
So in my opinion this should behave maybe like this:
…itvinov)
This PR was merged into the 2.x branch.
Discussion
----------
#1083. Fixed issue with option user_id_claim.
Fixed issue with configuration option `user_id_claim`
Commits
-------
d5d2b6f#1083. Fixed issue with option user_id_claim.
Spomky
pushed a commit
to Spomky/LexikJWTAuthenticationBundle
that referenced
this issue
May 13, 2023
Using
user_identity_field
in configuration generates depreacted notification:But using
user_id_claim
will not behave as we expect when using value other thanusername
, the methodJWTManager::addUserIdentityToPayload
will always consider values fromuser_identity_field
(as default value which isusername
).So if we have configuration like this:
Then last line will be evaulated like this:
Instead it should first consider
$this->userIdClaim
field first and then try to access field using$this->userIdentityField
.So in my opinion this should behave maybe like this:
The text was updated successfully, but these errors were encountered: