Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Security] LogicException: %scheb_two_factor.security_voter.class% should implement the VoterInterface interface when used as voter #23924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
umpirsky opened this issue Aug 17, 2017 · 1 comment

Comments

@umpirsky
Copy link
Contributor

umpirsky commented Aug 17, 2017

Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Symfony version 3.4.x-dev (8c4a1e7)

Error:

PHP Fatal error:  Uncaught Symfony\Component\DependencyInjection\Exception\LogicException: %scheb_two_factor.security_voter.class% should implement the Symfony\Component\Security\Core\Authorization\Voter\VoterInterface interface when used as voter. in vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php:54

This service is defined in https://github.com/scheb/two-factor-bundle/blob/master/Resources/config/security.xml#L52. Looks like class is not resolved in https://github.com/symfony/security-bundle/blob/master/DependencyInjection/Compiler/AddSecurityVotersPass.php#L45.
It returns parameter instead.
Error is going away when I hardcode FQCN instead of %scheb_two_factor.security_voter.class% parameter.

I've read https://github.com/symfony/symfony/blob/master/UPGRADE-3.4.md#securitybundle and this class does implement VoterInterface, the problem lies in fact that AddSecurityVotersPass is operating with "%scheb_two_factor.security_voter.class%" string instead with FQCN.

/cc @nicolas-grekas

@xabbuh
Copy link
Member

xabbuh commented Aug 18, 2017

Thanks for reporting, but I close here as a duplicate of #23733.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants