Index: /jwt-authentication-bundle/Security/Guard/JWTTokenAuthenticator.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- /jwt-authentication-bundle/Security/Guard/JWTTokenAuthenticator.php (date 1549551465096) +++ /jwt-authentication-bundle/Security/Guard/JWTTokenAuthenticator.php (date 1549551465096) @@ -26,6 +26,7 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; +use Symfony\Component\Security\Core\User\ChainUserProvider; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; use Symfony\Component\Security\Guard\AbstractGuardAuthenticator; @@ -267,8 +268,13 @@ { if ($userProvider instanceof PayloadAwareUserProviderInterface) { return $userProvider->loadUserByUsernameAndPayload($identity, $payload); + } elseif ($userProvider instanceof ChainUserProvider){ + foreach ($userProvider->getProviders() as $provider) { + if ($provider instanceof PayloadAwareUserProviderInterface) { + return $provider->loadUserByUsernameAndPayload($identity, $payload); + } + } } - return $userProvider->loadUserByUsername($identity); } }