scheb / two-factor-bundle

[ABANDONED] Two-factor authentication for Symfony 2 & 3 applications 🔐. Please use the newer versions from https://github.com/scheb/2fa.
https://github.com/scheb/2fa
MIT License
386 stars 110 forks source link

AuthenticatedTokenHandler Compile Error #272

Closed ntasker closed 4 years ago

ntasker commented 4 years ago

Bundle version: 4.14 Symfony version: 3.4

Description

When I install the bundle and follow the guide I get a fatal exception -

Compile Error: Declaration of AuthenticatedTokenHandler_e3677d3::beginTwoFactorAuthentication(Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextInterface $context) must be compatible with Scheb\TwoFactorBundle\Security\TwoFactor\Handler\AuthenticationHandlerInterface::beginTwoFactorAuthentication(Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextInterface $context): Symfony\Component\Security\Core\Authentication\Token\TokenInterface

Any ideas on how to resolve this? I've tried clearing cache and deleting vendor and re-installing but the error still persists

scheb commented 4 years ago

Hmm, that's weird. Can you nail down where this class AuthenticatedTokenHandler_e3677d3 is coming from (like the file where it is declared)? The alphanumeric suffix shows me it is not from the bundle itself, but is rather a generated class by something else.

Could you list the packages that you have installed in your project?

Which PHP version are you using?

ntasker commented 4 years ago

The class seems to be coming from - var/cache/dev/ContainerVpl2jqt/AuthenticatedTokenHandler_e3677d3.php

The packages I have installed are as follows:


beberlei/assert                       v3.2.7  Thin assertion library for in...
behat/gherkin                         v4.6.0  Gherkin DSL parser for PHP 5.3
behat/transliterator                  v1.3.0  String transliterator
bramus/ansi-php                       3.0.3   ANSI Control Functions and AN...
bramus/monolog-colored-line-formatter 2.0.3   Colored Line Formatter for Mo...
brianium/habitat                      v1.0.0  A dependable php environment
brianium/paratest                     0.15.0  Parallel testing for PHP
codeception/codeception               2.5.6   BDD-style testing framework
codeception/phpunit-wrapper           6.1.3   PHPUnit classes used by Codec...
codeception/stub                      2.0.4   Flexible Stub wrapper for PHP...
composer/semver                       1.5.1   Semver library that offers ut...
doctrine/annotations                  v1.8.0  Docblock Annotations Parser
doctrine/cache                        1.10.0  PHP Doctrine Cache library is...
doctrine/collections                  1.6.4   PHP Doctrine Collections libr...
doctrine/common                       2.12.0  PHP Doctrine Common project i...
doctrine/data-fixtures                1.3.3   Data Fixtures for all Doctrin...
doctrine/dbal                         v2.9.3  Powerful PHP database abstrac...
doctrine/doctrine-bundle              1.12.7  Symfony DoctrineBundle
doctrine/doctrine-cache-bundle        1.4.0   Symfony Bundle for Doctrine C...
doctrine/doctrine-fixtures-bundle     v2.4.1  Symfony DoctrineFixturesBundle
doctrine/event-manager                1.1.0   The Doctrine Event Manager is...
doctrine/inflector                    1.3.1   Common String Manipulations w...
doctrine/instantiator                 1.3.0   A small, lightweight utility ...
doctrine/lexer                        1.0.2   PHP Doctrine Lexer parser lib...
doctrine/orm                          v2.7.0  Object-Relational-Mapper for PHP
doctrine/persistence                  1.3.6   The Doctrine Persistence proj...
doctrine/reflection                   v1.1.0  The Doctrine Reflection proje...
facebook/webdriver                    1.8.0   A PHP client for Selenium Web...
fig/link-util                         1.1.0   Common utility implementation...
friendsofsymfony/rest-bundle          1.7.7   This Bundle provides various ...
friendsofsymfony/user-bundle          v2.1.2  Symfony FOSUserBundle
fzaninotto/faker                      v1.9.1  Faker is a PHP library that g...
gedmo/doctrine-extensions             v2.4.39 Doctrine2 behavioral extensions
guzzle/guzzle                         v3.8.1  Guzzle is a PHP HTTP client l...
guzzlehttp/guzzle                     6.5.2   Guzzle is a PHP HTTP client l...
guzzlehttp/promises                   v1.3.1  Guzzle promises library
guzzlehttp/psr7                       1.6.1   PSR-7 message implementation ...
incenteev/composer-parameter-handler  v2.1.3  Composer script handling your...
jdorn/sql-formatter                   v1.2.17 a PHP SQL highlighting library
jms/aop-bundle                        1.3.0   Adds AOP capabilities to Symf...
jms/cg                                1.2.0   Toolset for generating PHP code
jms/di-extra-bundle                   1.9.2   Allows to configure dependenc...
jms/metadata                          1.7.0   Class/method/property metadat...
jms/parser-lib                        1.0.0   A library for easily creating...
jms/security-extra-bundle             1.6.1   Enhances the Symfony2 Securit...
jms/serializer                        1.14.0  Library for (de-)serializing ...
jms/serializer-bundle                 1.5.0   Allows you to easily serializ...
knplabs/knp-menu                      2.6.0   An object oriented menu library
knplabs/knp-menu-bundle               v2.3.0  This bundle provides an integ...
knpuniversity/oauth2-client-bundle    v1.33.0 Integration with league/oauth...
kriswallsmith/assetic                 v1.4.0  Asset Management for PHP
lcobucci/jwt                          3.3.1   A simple library to work with...
league/oauth1-client                  1.7.0   OAuth 1.0 Client Library
league/oauth2-client                  2.4.1   OAuth 2.0 Client Library
league/oauth2-facebook                2.0.1   Facebook OAuth 2.0 Client Pro...
league/oauth2-linkedin                2.1.0   LinkedIn OAuth 2.0 Client Pro...
lexik/form-filter-bundle              v5.0.10 This bundle aim to provide cl...
lexik/jwt-authentication-bundle       v2.6.5  This bundle provides JWT auth...
liip/functional-test-bundle           1.11.0  This bundles provides additio...
liuggio/fastest                       v1.6.1  Simple parallel testing execu...
mangopay/php-sdk-v2                   2.13.1  PHP SDK for MANGOPAY
michelf/php-markdown                  1.9.0   PHP Markdown
monolog/monolog                       1.25.3  Sends your logs to files, soc...
mopa/bootstrap-bundle                 v3.3.0  Easy integration of twitters ...
mopa/composer-bridge                  v1.5.0  Symfony2 Composer Bridge
myclabs/deep-copy                     1.9.5   Create deep copies (clones) o...
namshi/cuzzle                         2.0.3   Get the cURL shell command fr...
namshi/jose                           7.2.3   JSON Object Signing and Encry...
nelmio/alice                          v2.3.5  Expressive fixtures generator
nelmio/api-doc-bundle                 2.13.4  Generates documentation for y...
ocramius/proxy-manager                1.0.2   A library providing utilities...
pagerfanta/pagerfanta                 v2.1.3  Pagination for PHP
paragonie/constant_time_encoding      v2.3.0  Constant-time Implementations...
paragonie/random_compat               v2.0.18 PHP 5.x polyfill for random_b...
phpcollection/phpcollection           0.5.0   General-Purpose Collection Li...
phpdocumentor/reflection-common       2.0.0   Common reflection classes use...
phpdocumentor/reflection-docblock     4.3.4   With this component, a librar...
phpdocumentor/type-resolver           1.0.1   A PSR-5 based resolver of Cla...
phpoption/phpoption                   1.7.2   Option Type for PHP
phpspec/prophecy                      v1.10.2 Highly opinionated mocking fr...
phpunit/php-code-coverage             4.0.8   Library that provides collect...
phpunit/php-file-iterator             1.4.5   FilterIterator implementation...
phpunit/php-text-template             1.2.1   Simple template engine.
phpunit/php-timer                     1.0.9   Utility class for timing
phpunit/php-token-stream              2.0.2   Wrapper around PHP's tokenize...
phpunit/phpunit                       5.7.27  The PHP Unit Testing framework.
phpunit/phpunit-mock-objects          3.4.4   Mock Object library for PHPUnit
psr/cache                             1.0.1   Common interface for caching ...
psr/container                         1.0.0   Common Container Interface (P...
psr/http-message                      1.0.1   Common interface for HTTP mes...
psr/link                              1.0.0   Common interfaces for HTTP links
psr/log                               1.1.2   Common interface for logging ...
psr/simple-cache                      1.0.1   Common interfaces for simple ...
ralouphie/getallheaders               3.0.3   A polyfill for getallheaders.
sameer-shelavale/php-countries-array  v1.0.5  PHP class to get array of cou...
scheb/two-factor-bundle               v4.13.0 Provides two-factor authentic...
sebastian/code-unit-reverse-lookup    1.0.1   Looks up which function or me...
sebastian/comparator                  1.2.4   Provides the functionality to...
sebastian/diff                        1.4.3   Diff implementation
sebastian/environment                 2.0.0   Provides functionality to han...
sebastian/exporter                    2.0.0   Provides the functionality to...
sebastian/global-state                1.1.1   Snapshotting of global state
sebastian/object-enumerator           2.0.1   Traverses array structures an...
sebastian/recursion-context           2.0.0   Provides functionality to rec...
sebastian/resource-operations         1.0.0   Provides a list of PHP built-...
sebastian/version                     2.0.1   Library that helps with manag...
sensio/distribution-bundle            v5.0.25 Base bundle for Symfony Distr...
sensio/framework-extra-bundle         v3.0.29 This bundle provides a way to...
sensio/generator-bundle               v3.1.7  This bundle generates code fo...
sensiolabs/security-checker           v6.0.3  A security checker for your c...
sonata-project/exporter               1.11.1  Lightweight Exporter library
spomky-labs/otphp                     v9.1.4  A PHP library for generating ...
stof/doctrine-extensions-bundle       v1.3.0  Integration of the gedmo/doct...
swiftmailer/swiftmailer               v5.4.12 Swiftmailer, free feature-ric...
symfony/assetic-bundle                v2.8.2  Integrates Assetic into Symfony2
symfony/http-client                   v4.4.4  Symfony HttpClient component
symfony/http-client-contracts         v1.1.8  Generic abstractions related ...
symfony/mime                          v4.4.4  A library to manipulate MIME ...
symfony/monolog-bundle                v3.5.0  Symfony MonologBundle
symfony/phpunit-bridge                v2.8.52 Symfony PHPUnit Bridge
symfony/polyfill-apcu                 v1.14.0 Symfony polyfill backporting ...
symfony/polyfill-ctype                v1.14.0 Symfony polyfill for ctype fu...
symfony/polyfill-intl-icu             v1.14.0 Symfony polyfill for intl's I...
symfony/polyfill-intl-idn             v1.14.0 Symfony polyfill for intl's i...
symfony/polyfill-mbstring             v1.14.0 Symfony polyfill for the Mbst...
symfony/polyfill-php56                v1.14.0 Symfony polyfill backporting ...
symfony/polyfill-php70                v1.14.0 Symfony polyfill backporting ...
symfony/polyfill-php72                v1.14.0 Symfony polyfill backporting ...
symfony/polyfill-php73                v1.14.0 Symfony polyfill backporting ...
symfony/polyfill-util                 v1.14.0 Symfony utilities for portabi...
symfony/security-acl                  v3.0.4  Symfony Security Component - ...
symfony/service-contracts             v1.1.8  Generic abstractions related ...
symfony/swiftmailer-bundle            v2.6.7  Symfony SwiftmailerBundle
symfony/symfony                       v3.4.37 The Symfony PHP framework
twig/extensions                       v1.5.4  Common additional features fo...
twig/twig                             v2.12.5 Twig, the flexible, fast, and...
vich/uploader-bundle                  1.8.8   Ease file uploads attached to...
webmozart/assert                      1.7.0   Assertions to validate method...
willdurand/jsonp-callback-validator   v1.1.0  JSONP callback validator.
willdurand/negotiation                1.5.0   Content Negotiation tools for...
zendframework/zend-code               2.6.3   provides facilities to genera...
zendframework/zend-eventmanager       3.2.1   Trigger and listen to events ...

And my PHP version is: 7.1.33

Thank you for your help

scheb commented 4 years ago

Seems to be this issue: https://github.com/symfony/symfony/issues/18367

It says you should use ocramius/proxy-manager version 2.

ntasker commented 4 years ago

Thank you, that seems to have fixed the issue