从2.8升级到3.4时会出现AuthenticationCredentialsNotFoundException

时间:2019-04-11 07:08:27

标签: php symfony symfony-3.4

我正在将Symfony从V2.8升级到V3.4 我做了大多数更改来解决升级时的折旧和冲突,现在我陷入了一个奇怪的错误,当我尝试使用

登录时会抛出AuthenticationCredentialsNotFoundException

凭据。 v2.8中不存在此问题 Composer安装/更新工作正常,没有任何错误

``GENERAL EXCEPTION: The token storage contains no authentication token. One possible reason may be that there is no firewall configured for this URL. in /var/www/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authorization/AuthorizationChecker.php line 55 [] []
[2019-04-11 14:38:00] app.ERROR: Exception caught by Listener::  [{"file":"\/Listener\/AuthTokenListener.php","line":137,"function":"isGranted","class":"Symfony\\Component\\Security\\Core\\Authorization\\AuthorizationChecker","type":"->","args":["IS_AUTHENTICATED_ANONYMOUSLY"]},{"file":"\/var\/www\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/EventDispatcher\/EventDispatcher.php","line":212,"function":"onRequest","class":"Insead\\MIMBundle\\Listener\\AuthTokenListener","type":"->","args":[{},"kernel.request",{}]},``

第137行是这样的

    if(~login success){
      // runs this block else down
    } else {

        $securityContext = $this->security;


        if ($securityContext->isGranted('IS_AUTHENTICATED_ANONYMOUSLY')) {
            return;
        } else {
            throw new SessionTimeoutException();
        }

    }

我该如何解决?我检查了大多数论坛上有关升级的内容,

0 个答案:

没有答案