当我尝试使用php bin / console启动我自定义的Symfony命令时 我得到了这个奇怪的错误:
[Symfony的\元器件\安全\核心\异常\ AuthenticationCredentialsNotFoundException]
令牌存储不包含身份验证令牌。一种可能 原因可能是没有为此URL配置防火墙
似乎负责的行是
$user = $em->getRepository('CoreUserBundle:User')->findOneById($deck['user_id']);
if ($user != null)
{
$deck_entity = new Deck();
$deck_entity->SetId($deck['id']);
$deck_entity->SetUser($user);
$deck_entity->SetTitle($deck['titre']);
$deck_entity->SetClass($deck['classe']);
$deck_entity->SetStyle("None");
$deck_entity->SetContentHtml($deck['contenu_html']);
if (isset($deck['contenu_bbcode']))
$deck_entity->SetContentBBCode($deck['contenu_bbcode']);
$deck_entity->SetVideo($deck['video']);
$deck_entity->SetVersion($deck['version']);
$deck_entity->SetIsUpdated($deck['a_jour']);
$deck_entity->SetCraftCost($deck['craft_cout']);
$deck_entity->SetCreationDate(new \DateTime($deck['creation']));
$deck_entity->SetEditionDate(new \DateTime($deck['edition']));
$deck_entity->SetDeckType($deck['deck_type']);
$em->persist($deck_entity);
$metadata = $em->getClassMetaData(get_class($deck_entity));
$metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE);
}
UPDATE:似乎错误发生在持久化实体Deck()的时刻。
我的防火墙安全性
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
form_login:
login_path: /login
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager
remember_me: true
oauth:
resource_owners:
facebook: /login/check-facebook
google: /login/check-google
login_path: /login
failure_path: /login
oauth_user_provider:
service: core.user.user_provider
remember_me:
secret: "%secret%"
name: f1e56d001
lifetime: 604800
httponly: true
domain: xxxx.eu
logout:
path: fos_user_security_logout
handlers: ['sonata.page.cms_manager_selector']
target: /
anonymous: true
switch_user:
role: ROLE_ADMINISTRATOR
parameter: connect_as
我不明白我的意思,错误似乎告诉我,我没有经过身份验证,但是自从我使用控制台以来该怎么办?
提前致谢。
答案 0 :(得分:0)