I'm just creating a new Symfony2 project based on version 2.4.
Working with http://symfony.com/blog/new-in-symfony-2-4-customize-the-security-features-with-ease I created a UserProvider and Authenticator.
According to provided examples authenticateToken()
should return proper token or throw new AuthenticationException('message')
. In first case when User can be authenticated - everything works fine but when an Exception is thrown - server is not giving 401 or 403 with just regular auth error but is giving 500 with A Token was not found in the SecurityContext!
I think it is a new implementation bug, am I right?